Skip to content

Commit a25b19f

Browse files
Minor cleanup Aggregations Module
Just some random finds of unused code from researching memory things.
1 parent f7349e2 commit a25b19f

File tree

6 files changed

+6
-30
lines changed

6 files changed

+6
-30
lines changed

modules/aggregations/src/main/java/org/elasticsearch/aggregations/bucket/adjacency/AdjacencyMatrixAggregationBuilder.java

-7
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,6 @@ public AdjacencyMatrixAggregationBuilder separator(String separator) {
173173
return this;
174174
}
175175

176-
/**
177-
* Get the separator used to join pairs of bucket keys
178-
*/
179-
public String separator() {
180-
return separator;
181-
}
182-
183176
/**
184177
* Get the filters. This will be an unmodifiable map
185178
*/

modules/aggregations/src/main/java/org/elasticsearch/aggregations/bucket/adjacency/InternalAdjacencyMatrix.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class InternalAdjacencyMatrix extends InternalMultiBucketAggregation<Inte
3535
public static class InternalBucket extends InternalMultiBucketAggregation.InternalBucket implements AdjacencyMatrix.Bucket {
3636

3737
private final String key;
38-
private long docCount;
38+
private final long docCount;
3939
InternalAggregations aggregations;
4040

4141
public InternalBucket(String key, long docCount, InternalAggregations aggregations) {

modules/aggregations/src/main/java/org/elasticsearch/aggregations/bucket/histogram/AutoDateHistogramAggregationBuilder.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,6 @@ public AutoDateHistogramAggregationBuilder setNumBuckets(int numBuckets) {
188188
return this;
189189
}
190190

191-
public int getNumBuckets() {
192-
return numBuckets;
193-
}
194-
195191
@Override
196192
public BucketCardinality bucketCardinality() {
197193
return BucketCardinality.MANY;
@@ -236,8 +232,7 @@ static Rounding createRounding(Rounding.DateTimeUnit interval, ZoneId timeZone)
236232
if (timeZone != null) {
237233
tzRoundingBuilder.timeZone(timeZone);
238234
}
239-
Rounding rounding = tzRoundingBuilder.build();
240-
return rounding;
235+
return tzRoundingBuilder.build();
241236
}
242237

243238
@Override

modules/aggregations/src/main/java/org/elasticsearch/aggregations/bucket/histogram/AutoDateHistogramAggregator.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ private static class FromSingle extends AutoDateHistogramAggregator {
231231
}
232232

233233
@Override
234-
protected LeafBucketCollector getLeafCollector(SortedNumericDocValues values, LeafBucketCollector sub) throws IOException {
234+
protected LeafBucketCollector getLeafCollector(SortedNumericDocValues values, LeafBucketCollector sub) {
235235
return new LeafBucketCollectorBase(sub, values) {
236236
@Override
237237
public void collect(int doc, long owningBucketOrd) throws IOException {
@@ -441,7 +441,7 @@ private static class FromMany extends AutoDateHistogramAggregator {
441441
}
442442

443443
@Override
444-
protected LeafBucketCollector getLeafCollector(SortedNumericDocValues values, LeafBucketCollector sub) throws IOException {
444+
protected LeafBucketCollector getLeafCollector(SortedNumericDocValues values, LeafBucketCollector sub) {
445445
return new LeafBucketCollectorBase(sub, values) {
446446
@Override
447447
public void collect(int doc, long owningBucketOrd) throws IOException {

modules/aggregations/src/main/java/org/elasticsearch/aggregations/bucket/histogram/InternalAutoDateHistogram.java

+1-5
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,6 @@ public int compareKey(Bucket other) {
134134
return Long.compare(key, other.key);
135135
}
136136

137-
public DocValueFormat getFormatter() {
138-
return format;
139-
}
140-
141137
Bucket finalizeSampling(SamplingContext samplingContext) {
142138
return new Bucket(
143139
key,
@@ -279,7 +275,7 @@ public int getTargetBuckets() {
279275
return targetBuckets;
280276
}
281277

282-
public BucketInfo getBucketInfo() {
278+
BucketInfo getBucketInfo() {
283279
return bucketInfo;
284280
}
285281

modules/aggregations/src/main/java/org/elasticsearch/aggregations/bucket/timeseries/TimeSeriesAggregationBuilder.java

+1-9
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class TimeSeriesAggregationBuilder extends AbstractAggregationBuilder<Tim
3535
public static final ParseField SIZE_FIELD = new ParseField("size");
3636
public static final InstantiatingObjectParser<TimeSeriesAggregationBuilder, String> PARSER;
3737

38-
private boolean keyed;
38+
private final boolean keyed;
3939
private int size;
4040

4141
private static final int DEFAULT_SIZE = MultiBucketConsumerService.DEFAULT_MAX_BUCKETS;
@@ -126,14 +126,6 @@ public boolean isInSortOrderExecutionRequired() {
126126
return true;
127127
}
128128

129-
public boolean isKeyed() {
130-
return keyed;
131-
}
132-
133-
public void setKeyed(boolean keyed) {
134-
this.keyed = keyed;
135-
}
136-
137129
public TimeSeriesAggregationBuilder setSize(int size) {
138130
if (size <= 0) {
139131
throw new IllegalArgumentException("[size] must be greater than 0. Found [" + size + "] in [" + name + "]");

0 commit comments

Comments
 (0)