Skip to content

Commit ba9ed19

Browse files
Remvoe some more dead code from o.e.search.aggregations (elastic#121498)
Just some obvious dead code removal.
1 parent 2a59ce0 commit ba9ed19

32 files changed

+34
-125
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ private List<B> reducePipelineBuckets(AggregationReduceContext reduceContext, Pi
211211
List<B> reducedBuckets = new ArrayList<>();
212212
for (B bucket : getBuckets()) {
213213
List<InternalAggregation> aggs = new ArrayList<>();
214-
for (Aggregation agg : bucket.getAggregations()) {
214+
for (InternalAggregation agg : bucket.getAggregations()) {
215215
PipelineTree subTree = pipelineTree.subTree(agg.getName());
216-
aggs.add(((InternalAggregation) agg).reducePipelines((InternalAggregation) agg, reduceContext, subTree));
216+
aggs.add(agg.reducePipelines(agg, reduceContext, subTree));
217217
}
218218
reducedBuckets.add(createBucket(InternalAggregations.from(aggs), bucket));
219219
}

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ public InvalidAggregationPathException(String msg) {
2020
super(msg);
2121
}
2222

23-
public InvalidAggregationPathException(String msg, Throwable cause) {
24-
super(msg, cause);
25-
}
26-
2723
public InvalidAggregationPathException(StreamInput in) throws IOException {
2824
super(in);
2925
}

server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ protected LeafBucketCollector getLeafCollector(AggregationExecutionContext aggCt
461461
// Visit documents sorted by the leading source of the composite definition and terminates
462462
// when the leading source value is guaranteed to be greater than the lowest composite bucket
463463
// in the queue.
464-
DocIdSet docIdSet = sortedDocsProducer.processLeaf(topLevelQuery(), queue, aggCtx.getLeafReaderContext(), fillDocIdSet);
464+
DocIdSet docIdSet = sortedDocsProducer.processLeaf(queue, aggCtx.getLeafReaderContext(), fillDocIdSet);
465465
if (fillDocIdSet) {
466466
entries.add(new Entry(aggCtx, docIdSet));
467467
}

server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/PointsSortedDocsProducer.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import org.apache.lucene.index.PointValues;
1414
import org.apache.lucene.search.CollectionTerminatedException;
1515
import org.apache.lucene.search.DocIdSet;
16-
import org.apache.lucene.search.Query;
1716
import org.apache.lucene.util.DocIdSetBuilder;
1817

1918
import java.io.IOException;
@@ -36,8 +35,7 @@ class PointsSortedDocsProducer extends SortedDocsProducer {
3635
}
3736

3837
@Override
39-
DocIdSet processLeaf(Query query, CompositeValuesCollectorQueue queue, LeafReaderContext context, boolean fillDocIdSet)
40-
throws IOException {
38+
DocIdSet processLeaf(CompositeValuesCollectorQueue queue, LeafReaderContext context, boolean fillDocIdSet) throws IOException {
4139
final PointValues values = context.reader().getPointValues(field);
4240
if (values == null) {
4341
// no value for the field

server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/SortedDocsProducer.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import org.apache.lucene.index.LeafReaderContext;
1313
import org.apache.lucene.search.DocIdSet;
1414
import org.apache.lucene.search.DocIdSetIterator;
15-
import org.apache.lucene.search.Query;
1615
import org.apache.lucene.util.Bits;
1716
import org.apache.lucene.util.DocIdSetBuilder;
1817
import org.elasticsearch.core.Nullable;
@@ -99,6 +98,5 @@ public void collect(int doc, long bucket) throws IOException {
9998
* Returns the {@link DocIdSet} of the documents that contain a top composite bucket in this leaf or
10099
* {@link DocIdSet#EMPTY} if <code>fillDocIdSet</code> is false.
101100
*/
102-
abstract DocIdSet processLeaf(Query query, CompositeValuesCollectorQueue queue, LeafReaderContext context, boolean fillDocIdSet)
103-
throws IOException;
101+
abstract DocIdSet processLeaf(CompositeValuesCollectorQueue queue, LeafReaderContext context, boolean fillDocIdSet) throws IOException;
104102
}

server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/TermsSortedDocsProducer.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import org.apache.lucene.index.Terms;
1515
import org.apache.lucene.index.TermsEnum;
1616
import org.apache.lucene.search.DocIdSet;
17-
import org.apache.lucene.search.Query;
1817
import org.apache.lucene.util.BytesRef;
1918
import org.apache.lucene.util.DocIdSetBuilder;
2019

@@ -29,8 +28,7 @@ class TermsSortedDocsProducer extends SortedDocsProducer {
2928
}
3029

3130
@Override
32-
DocIdSet processLeaf(Query query, CompositeValuesCollectorQueue queue, LeafReaderContext context, boolean fillDocIdSet)
33-
throws IOException {
31+
DocIdSet processLeaf(CompositeValuesCollectorQueue queue, LeafReaderContext context, boolean fillDocIdSet) throws IOException {
3432
final Terms terms = context.reader().terms(field);
3533
if (terms == null) {
3634
// no value for the field

server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalDateRange.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,7 @@ public class InternalDateRange extends InternalRange<InternalDateRange.Bucket, I
2525

2626
public static class Bucket extends InternalRange.Bucket {
2727

28-
public Bucket(
29-
String key,
30-
double from,
31-
double to,
32-
long docCount,
33-
List<InternalAggregation> aggregations,
34-
boolean keyed,
35-
DocValueFormat formatter
36-
) {
28+
public Bucket(String key, double from, double to, long docCount, List<InternalAggregation> aggregations, DocValueFormat formatter) {
3729
super(key, from, to, docCount, InternalAggregations.from(aggregations), formatter);
3830
}
3931

server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/BytesKeyedBucketOrds.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -75,24 +75,6 @@ public interface BucketOrdsEnum {
7575
* Read the current value.
7676
*/
7777
void readValue(BytesRef dest);
78-
79-
/**
80-
* An {@linkplain BucketOrdsEnum} that is empty.
81-
*/
82-
BucketOrdsEnum EMPTY = new BucketOrdsEnum() {
83-
@Override
84-
public boolean next() {
85-
return false;
86-
}
87-
88-
@Override
89-
public long ord() {
90-
return 0;
91-
}
92-
93-
@Override
94-
public void readValue(BytesRef dest) {}
95-
};
9678
}
9779

9880
/**

server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalSignificantTerms.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ protected Bucket(long subsetDf, long supersetDf, InternalAggregations aggregatio
7272
/**
7373
* Read from a stream.
7474
*/
75-
protected Bucket(StreamInput in, DocValueFormat format) {
75+
protected Bucket(DocValueFormat format) {
7676
this.format = format;
7777
}
7878

server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantLongTerms.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public Bucket(long subsetDf, long supersetDf, long term, InternalAggregations ag
3737
}
3838

3939
Bucket(StreamInput in, DocValueFormat format) throws IOException {
40-
super(in, format);
40+
super(format);
4141
subsetDf = in.readVLong();
4242
supersetDf = in.readVLong();
4343
term = in.readLong();

0 commit comments

Comments
 (0)