Skip to content

Commit a67c91e

Browse files
committed
Revert "Fix line length offenders in the o.e.search package. (#36223)"
This reverts commit 5f3893f.
1 parent fcde585 commit a67c91e

File tree

146 files changed

+1940
-2776
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+1940
-2776
lines changed

buildSrc/src/main/resources/checkstyle_suppressions.xml

Lines changed: 89 additions & 0 deletions
Large diffs are not rendered by default.

server/src/main/java/org/elasticsearch/script/ScriptService.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,8 @@ public ScriptService(Settings settings, Map<String, ScriptEngine> engines, Map<S
138138
this.contexts = Objects.requireNonNull(contexts);
139139

140140
if (Strings.hasLength(settings.get(DISABLE_DYNAMIC_SCRIPTING_SETTING))) {
141-
throw new IllegalArgumentException(DISABLE_DYNAMIC_SCRIPTING_SETTING + " is not a supported setting, replace with " +
142-
"fine-grained script settings. \n Dynamic scripts can be enabled for all languages and all operations not " +
143-
"using `script.disable_dynamic: false` in elasticsearch.yml");
141+
throw new IllegalArgumentException(DISABLE_DYNAMIC_SCRIPTING_SETTING + " is not a supported setting, replace with fine-grained script settings. \n" +
142+
"Dynamic scripts can be enabled for all languages and all operations not using `script.disable_dynamic: false` in elasticsearch.yml");
144143
}
145144

146145
this.typesAllowed = TYPES_ALLOWED_SETTING.exists(settings) ? new HashSet<>() : null;
@@ -366,8 +365,7 @@ public <FactoryType> FactoryType compile(Script script, ScriptContext<FactoryTyp
366365
// TODO: remove this try-catch completely, when all script engines have good exceptions!
367366
throw good; // its already good
368367
} catch (Exception exception) {
369-
throw new GeneralScriptException("Failed to compile " + type + " script [" + id + "] using lang [" + lang + "]",
370-
exception);
368+
throw new GeneralScriptException("Failed to compile " + type + " script [" + id + "] using lang [" + lang + "]", exception);
371369
}
372370

373371
// Since the cache key is the script content itself we don't need to

server/src/main/java/org/elasticsearch/search/MultiValueMode.java

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ protected long pick(SortedNumericDocValues values) throws IOException {
6363
}
6464

6565
@Override
66-
protected long pick(SortedNumericDocValues values, long missingValue, DocIdSetIterator docItr, int startDoc, int endDoc,
67-
int maxChildren) throws IOException {
66+
protected long pick(SortedNumericDocValues values, long missingValue, DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren) throws IOException {
6867
int totalCount = 0;
6968
long totalValue = 0;
7069
int count = 0;
@@ -95,8 +94,7 @@ protected double pick(SortedNumericDoubleValues values) throws IOException {
9594
}
9695

9796
@Override
98-
protected double pick(SortedNumericDoubleValues values, double missingValue, DocIdSetIterator docItr, int startDoc, int endDoc,
99-
int maxChildren) throws IOException {
97+
protected double pick(SortedNumericDoubleValues values, double missingValue, DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren) throws IOException {
10098
int totalCount = 0;
10199
double totalValue = 0;
102100
int count = 0;
@@ -132,8 +130,7 @@ protected long pick(SortedNumericDocValues values) throws IOException {
132130
}
133131

134132
@Override
135-
protected long pick(SortedNumericDocValues values, long missingValue, DocIdSetIterator docItr, int startDoc, int endDoc,
136-
int maxChildren) throws IOException {
133+
protected long pick(SortedNumericDocValues values, long missingValue, DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren) throws IOException {
137134
int totalCount = 0;
138135
long totalValue = 0;
139136
int count = 0;
@@ -166,8 +163,7 @@ protected double pick(SortedNumericDoubleValues values) throws IOException {
166163
}
167164

168165
@Override
169-
protected double pick(SortedNumericDoubleValues values, double missingValue, DocIdSetIterator docItr, int startDoc, int endDoc,
170-
int maxChildren) throws IOException {
166+
protected double pick(SortedNumericDoubleValues values, double missingValue, DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren) throws IOException {
171167
int totalCount = 0;
172168
double totalValue = 0;
173169
int count = 0;
@@ -231,8 +227,7 @@ protected long pick(SortedNumericDocValues values) throws IOException {
231227
}
232228

233229
@Override
234-
protected long pick(SortedNumericDocValues values, long missingValue, DocIdSetIterator docItr, int startDoc, int endDoc,
235-
int maxChildren) throws IOException {
230+
protected long pick(SortedNumericDocValues values, long missingValue, DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren) throws IOException {
236231
boolean hasValue = false;
237232
long minValue = Long.MAX_VALUE;
238233
int count = 0;
@@ -254,8 +249,7 @@ protected double pick(SortedNumericDoubleValues values) throws IOException {
254249
}
255250

256251
@Override
257-
protected double pick(SortedNumericDoubleValues values, double missingValue, DocIdSetIterator docItr, int startDoc, int endDoc,
258-
int maxChildren) throws IOException {
252+
protected double pick(SortedNumericDoubleValues values, double missingValue, DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren) throws IOException {
259253
boolean hasValue = false;
260254
double minValue = Double.POSITIVE_INFINITY;
261255
int count = 0;
@@ -277,8 +271,7 @@ protected BytesRef pick(SortedBinaryDocValues values) throws IOException {
277271
}
278272

279273
@Override
280-
protected BytesRef pick(BinaryDocValues values, BytesRefBuilder builder, DocIdSetIterator docItr, int startDoc, int endDoc,
281-
int maxChildren) throws IOException {
274+
protected BytesRef pick(BinaryDocValues values, BytesRefBuilder builder, DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren) throws IOException {
282275
BytesRefBuilder bytesRefBuilder = null;
283276
int count = 0;
284277
for (int doc = startDoc; doc < endDoc; doc = docItr.nextDoc()) {
@@ -340,8 +333,7 @@ protected long pick(SortedNumericDocValues values) throws IOException {
340333
}
341334

342335
@Override
343-
protected long pick(SortedNumericDocValues values, long missingValue, DocIdSetIterator docItr, int startDoc, int endDoc,
344-
int maxChildren) throws IOException {
336+
protected long pick(SortedNumericDocValues values, long missingValue, DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren) throws IOException {
345337
boolean hasValue = false;
346338
long maxValue = Long.MIN_VALUE;
347339
int count = 0;
@@ -371,8 +363,7 @@ protected double pick(SortedNumericDoubleValues values) throws IOException {
371363
}
372364

373365
@Override
374-
protected double pick(SortedNumericDoubleValues values, double missingValue, DocIdSetIterator docItr, int startDoc, int endDoc,
375-
int maxChildren) throws IOException {
366+
protected double pick(SortedNumericDoubleValues values, double missingValue, DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren) throws IOException {
376367
boolean hasValue = false;
377368
double maxValue = Double.NEGATIVE_INFINITY;
378369
int count = 0;
@@ -402,8 +393,7 @@ protected BytesRef pick(SortedBinaryDocValues values) throws IOException {
402393
}
403394

404395
@Override
405-
protected BytesRef pick(BinaryDocValues values, BytesRefBuilder builder, DocIdSetIterator docItr, int startDoc, int endDoc,
406-
int maxChildren) throws IOException {
396+
protected BytesRef pick(BinaryDocValues values, BytesRefBuilder builder, DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren) throws IOException {
407397
BytesRefBuilder bytesRefBuilder = null;
408398
int count = 0;
409399
for (int doc = startDoc; doc < endDoc; doc = docItr.nextDoc()) {
@@ -518,8 +508,7 @@ protected long pick(SortedNumericDocValues values) throws IOException {
518508
* NOTE: Calling the returned instance on docs that are not root docs is illegal
519509
* The returned instance can only be evaluate the current and upcoming docs
520510
*/
521-
public NumericDocValues select(final SortedNumericDocValues values, final long missingValue, final BitSet parentDocs,
522-
final DocIdSetIterator childDocs, int maxDoc, int maxChildren) throws IOException {
511+
public NumericDocValues select(final SortedNumericDocValues values, final long missingValue, final BitSet parentDocs, final DocIdSetIterator childDocs, int maxDoc, int maxChildren) throws IOException {
523512
if (parentDocs == null || childDocs == null) {
524513
return FieldData.replaceMissing(DocValues.emptyNumeric(), missingValue);
525514
}
@@ -563,8 +552,7 @@ public long longValue() {
563552
};
564553
}
565554

566-
protected long pick(SortedNumericDocValues values, long missingValue, DocIdSetIterator docItr, int startDoc, int endDoc,
567-
int maxChildren) throws IOException {
555+
protected long pick(SortedNumericDocValues values, long missingValue, DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren) throws IOException {
568556
throw new IllegalArgumentException("Unsupported sort mode: " + this);
569557
}
570558

@@ -617,8 +605,7 @@ protected double pick(SortedNumericDoubleValues values) throws IOException {
617605
* NOTE: Calling the returned instance on docs that are not root docs is illegal
618606
* The returned instance can only be evaluate the current and upcoming docs
619607
*/
620-
public NumericDoubleValues select(final SortedNumericDoubleValues values, final double missingValue, final BitSet parentDocs,
621-
final DocIdSetIterator childDocs, int maxDoc, int maxChildren) throws IOException {
608+
public NumericDoubleValues select(final SortedNumericDoubleValues values, final double missingValue, final BitSet parentDocs, final DocIdSetIterator childDocs, int maxDoc, int maxChildren) throws IOException {
622609
if (parentDocs == null || childDocs == null) {
623610
return FieldData.replaceMissing(FieldData.emptyNumericDouble(), missingValue);
624611
}
@@ -654,8 +641,7 @@ public double doubleValue() throws IOException {
654641
};
655642
}
656643

657-
protected double pick(SortedNumericDoubleValues values, double missingValue, DocIdSetIterator docItr, int startDoc, int endDoc,
658-
int maxChildren) throws IOException {
644+
protected double pick(SortedNumericDoubleValues values, double missingValue, DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren) throws IOException {
659645
throw new IllegalArgumentException("Unsupported sort mode: " + this);
660646
}
661647

@@ -727,8 +713,7 @@ protected BytesRef pick(SortedBinaryDocValues values) throws IOException {
727713
* NOTE: Calling the returned instance on docs that are not root docs is illegal
728714
* The returned instance can only be evaluate the current and upcoming docs
729715
*/
730-
public BinaryDocValues select(final SortedBinaryDocValues values, final BytesRef missingValue, final BitSet parentDocs,
731-
final DocIdSetIterator childDocs, int maxDoc, int maxChildren) throws IOException {
716+
public BinaryDocValues select(final SortedBinaryDocValues values, final BytesRef missingValue, final BitSet parentDocs, final DocIdSetIterator childDocs, int maxDoc, int maxChildren) throws IOException {
732717
if (parentDocs == null || childDocs == null) {
733718
return select(FieldData.emptySortedBinary(), missingValue);
734719
}
@@ -771,8 +756,7 @@ public BytesRef binaryValue() throws IOException {
771756
};
772757
}
773758

774-
protected BytesRef pick(BinaryDocValues values, BytesRefBuilder builder, DocIdSetIterator docItr, int startDoc, int endDoc,
775-
int maxChildren) throws IOException {
759+
protected BytesRef pick(BinaryDocValues values, BytesRefBuilder builder, DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren) throws IOException {
776760
throw new IllegalArgumentException("Unsupported sort mode: " + this);
777761
}
778762

@@ -784,8 +768,7 @@ protected BytesRef pick(BinaryDocValues values, BytesRefBuilder builder, DocIdSe
784768
*/
785769
public SortedDocValues select(final SortedSetDocValues values) {
786770
if (values.getValueCount() >= Integer.MAX_VALUE) {
787-
throw new UnsupportedOperationException("fields containing more than " + (Integer.MAX_VALUE - 1) +
788-
" unique terms are unsupported");
771+
throw new UnsupportedOperationException("fields containing more than " + (Integer.MAX_VALUE - 1) + " unique terms are unsupported");
789772
}
790773

791774
final SortedDocValues singleton = DocValues.unwrapSingleton(values);
@@ -846,8 +829,7 @@ protected int pick(SortedSetDocValues values) throws IOException {
846829
* NOTE: Calling the returned instance on docs that are not root docs is illegal
847830
* The returned instance can only be evaluate the current and upcoming docs
848831
*/
849-
public SortedDocValues select(final SortedSetDocValues values, final BitSet parentDocs, final DocIdSetIterator childDocs,
850-
int maxChildren) throws IOException {
832+
public SortedDocValues select(final SortedSetDocValues values, final BitSet parentDocs, final DocIdSetIterator childDocs, int maxChildren) throws IOException {
851833
if (parentDocs == null || childDocs == null) {
852834
return select(DocValues.emptySortedSet());
853835
}

server/src/main/java/org/elasticsearch/search/aggregations/AggregatorFactories.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,7 @@ private void resolvePipelineAggregatorOrder(Map<String, AggregationBuilder> aggB
397397
}
398398
// Check the pipeline sub-aggregator factories
399399
if (!foundSubBuilder && (i == bucketsPathElements.size() - 1)) {
400-
Collection<PipelineAggregationBuilder> subPipelineBuilders = aggBuilder.factoriesBuilder
401-
.pipelineAggregatorBuilders;
400+
Collection<PipelineAggregationBuilder> subPipelineBuilders = aggBuilder.factoriesBuilder.pipelineAggregatorBuilders;
402401
for (PipelineAggregationBuilder subFactory : subPipelineBuilders) {
403402
if (aggName.equals(subFactory.getName())) {
404403
foundSubBuilder = true;

server/src/main/java/org/elasticsearch/search/aggregations/InternalMultiBucketAggregation.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@
2929
import java.util.List;
3030
import java.util.Map;
3131

32-
public abstract class InternalMultiBucketAggregation<A extends InternalMultiBucketAggregation,
33-
B extends InternalMultiBucketAggregation.InternalBucket>
32+
public abstract class InternalMultiBucketAggregation<A extends InternalMultiBucketAggregation, B extends InternalMultiBucketAggregation.InternalBucket>
3433
extends InternalAggregation implements MultiBucketsAggregation {
35-
3634
public InternalMultiBucketAggregation(String name, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) {
3735
super(name, pipelineAggregators, metaData);
3836
}

server/src/main/java/org/elasticsearch/search/aggregations/bucket/BucketsAggregator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ public final int bucketDocCount(long bucketOrd) {
116116
if (bucketOrd >= docCounts.size()) {
117117
// This may happen eg. if no document in the highest buckets is accepted by a sub aggregator.
118118
// For example, if there is a long terms agg on 3 terms 1,2,3 with a sub filter aggregator and if no document with 3 as a value
119-
// matches the filter, then the filter will never collect bucket ord 3. However, the long terms agg will call
120-
// bucketAggregations(3) on the filter aggregator anyway to build sub-aggregations.
119+
// matches the filter, then the filter will never collect bucket ord 3. However, the long terms agg will call bucketAggregations(3)
120+
// on the filter aggregator anyway to build sub-aggregations.
121121
return 0;
122122
} else {
123123
return docCounts.get(bucketOrd);

server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoHashGridAggregator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ public class GeoHashGridAggregator extends BucketsAggregator {
4747
private final LongHash bucketOrds;
4848

4949
GeoHashGridAggregator(String name, AggregatorFactories factories, GeoGridAggregationBuilder.CellIdSource valuesSource,
50-
int requiredSize, int shardSize, SearchContext aggregationContext, Aggregator parent,
51-
List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) throws IOException {
50+
int requiredSize, int shardSize, SearchContext aggregationContext, Aggregator parent, List<PipelineAggregator> pipelineAggregators,
51+
Map<String, Object> metaData) throws IOException {
5252
super(name, factories, aggregationContext, parent, pipelineAggregators, metaData);
5353
this.valuesSource = valuesSource;
5454
this.requiredSize = requiredSize;

server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/HistogramAggregator.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ public InternalAggregation buildAggregation(long bucket) throws IOException {
146146
if (minDocCount == 0) {
147147
emptyBucketInfo = new EmptyBucketInfo(interval, offset, minBound, maxBound, buildEmptySubAggregations());
148148
}
149-
return new InternalHistogram(name, buckets, order, minDocCount, emptyBucketInfo, formatter, keyed, pipelineAggregators(),
150-
metaData());
149+
return new InternalHistogram(name, buckets, order, minDocCount, emptyBucketInfo, formatter, keyed, pipelineAggregators(), metaData());
151150
}
152151

153152
@Override
@@ -156,8 +155,7 @@ public InternalAggregation buildEmptyAggregation() {
156155
if (minDocCount == 0) {
157156
emptyBucketInfo = new EmptyBucketInfo(interval, offset, minBound, maxBound, buildEmptySubAggregations());
158157
}
159-
return new InternalHistogram(name, Collections.emptyList(), order, minDocCount, emptyBucketInfo, formatter, keyed,
160-
pipelineAggregators(), metaData());
158+
return new InternalHistogram(name, Collections.emptyList(), order, minDocCount, emptyBucketInfo, formatter, keyed, pipelineAggregators(), metaData());
161159
}
162160

163161
@Override

server/src/main/java/org/elasticsearch/search/aggregations/bucket/missing/MissingAggregator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ public void collect(int doc, long bucket) throws IOException {
7272

7373
@Override
7474
public InternalAggregation buildAggregation(long owningBucketOrdinal) throws IOException {
75-
return new InternalMissing(name, bucketDocCount(owningBucketOrdinal), bucketAggregations(owningBucketOrdinal),
76-
pipelineAggregators(), metaData());
75+
return new InternalMissing(name, bucketDocCount(owningBucketOrdinal), bucketAggregations(owningBucketOrdinal), pipelineAggregators(),
76+
metaData());
7777
}
7878

7979
@Override

server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ public void collect(int childDoc, long bucket) throws IOException {
9494

9595
@Override
9696
public InternalAggregation buildAggregation(long owningBucketOrdinal) throws IOException {
97-
return new InternalReverseNested(name, bucketDocCount(owningBucketOrdinal), bucketAggregations(owningBucketOrdinal),
98-
pipelineAggregators(), metaData());
97+
return new InternalReverseNested(name, bucketDocCount(owningBucketOrdinal), bucketAggregations(owningBucketOrdinal), pipelineAggregators(),
98+
metaData());
9999
}
100100

101101
@Override

0 commit comments

Comments
 (0)