From 39d02e3a13b300e8e91d33309314c8c22eeb187a Mon Sep 17 00:00:00 2001 From: Finn Carroll Date: Sun, 18 Aug 2024 11:25:43 -0700 Subject: [PATCH] Spotless apply Signed-off-by: Finn Carroll --- .../aggregations/bucket/composite/CompositeAggregator.java | 2 +- .../aggregations/bucket/filterrewrite/AggregatorBridge.java | 2 +- .../bucket/filterrewrite/DateHistogramAggregatorBridge.java | 1 - .../filterrewrite/FilterRewriteOptimizationContext.java | 4 +--- .../bucket/histogram/AutoDateHistogramAggregator.java | 4 ++-- .../bucket/histogram/DateHistogramAggregator.java | 2 +- 6 files changed, 6 insertions(+), 9 deletions(-) diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregator.java index bb003568b8aa3..7fcfb66f7c75b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregator.java @@ -220,7 +220,7 @@ protected int rangeMax() { @Override protected long getOrd(int rangeIdx, PackedValueRanges ranges) { - assert(ranges != null); + assert (ranges != null); long rangeStart = LongPoint.decodeDimension(ranges.getLower(rangeIdx), 0); rangeStart = this.getFieldType().convertNanosToMillis(rangeStart); long ord = bucketOrds.add(0, getRoundingPrepared().round(rangeStart)); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/filterrewrite/AggregatorBridge.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/filterrewrite/AggregatorBridge.java index cd3f64ba72aca..94e59a57e979a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/filterrewrite/AggregatorBridge.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/filterrewrite/AggregatorBridge.java @@ -13,8 +13,8 @@ import org.apache.lucene.search.ScoreMode; import org.apache.lucene.search.Weight; import org.opensearch.index.mapper.MappedFieldType; -import org.opensearch.search.internal.SearchContext; import org.opensearch.search.aggregations.LeafBucketCollector; +import org.opensearch.search.internal.SearchContext; import java.io.IOException; import java.util.function.BiConsumer; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/filterrewrite/DateHistogramAggregatorBridge.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/filterrewrite/DateHistogramAggregatorBridge.java index 8d2b57aca1d3a..3e7aa93286963 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/filterrewrite/DateHistogramAggregatorBridge.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/filterrewrite/DateHistogramAggregatorBridge.java @@ -9,7 +9,6 @@ package org.opensearch.search.aggregations.bucket.filterrewrite; import org.apache.lucene.index.LeafReaderContext; - import org.opensearch.common.Rounding; import org.opensearch.index.mapper.DateFieldMapper; import org.opensearch.index.mapper.MappedFieldType; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/filterrewrite/FilterRewriteOptimizationContext.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/filterrewrite/FilterRewriteOptimizationContext.java index 8d4b1ef86639b..0fc7d170fb2c8 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/filterrewrite/FilterRewriteOptimizationContext.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/filterrewrite/FilterRewriteOptimizationContext.java @@ -66,9 +66,7 @@ private boolean canOptimize(final Object parent, SearchContext context) throws I boolean canOptimize = aggregatorBridge.canOptimize(); if (canOptimize) { - aggregatorBridge.setRangesConsumer((PackedValueRanges ranges) -> { - this.ranges = ranges; - }); + aggregatorBridge.setRangesConsumer((PackedValueRanges ranges) -> { this.ranges = ranges; }); this.shardId = context.indexShard().shardId().toString(); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregator.java index b4402575c37a7..c844f1f3d194a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregator.java @@ -56,9 +56,9 @@ import org.opensearch.search.aggregations.bucket.MergingBucketsDeferringCollector; import org.opensearch.search.aggregations.bucket.filterrewrite.DateHistogramAggregatorBridge; import org.opensearch.search.aggregations.bucket.filterrewrite.FilterRewriteOptimizationContext; +import org.opensearch.search.aggregations.bucket.filterrewrite.PackedValueRanges; import org.opensearch.search.aggregations.bucket.histogram.AutoDateHistogramAggregationBuilder.RoundingInfo; import org.opensearch.search.aggregations.bucket.terms.LongKeyedBucketOrds; -import org.opensearch.search.aggregations.bucket.filterrewrite.PackedValueRanges; import org.opensearch.search.aggregations.support.ValuesSource; import org.opensearch.search.aggregations.support.ValuesSourceConfig; import org.opensearch.search.internal.SearchContext; @@ -203,7 +203,7 @@ protected Prepared getRoundingPrepared() { @Override protected long getOrd(int rangeIdx, PackedValueRanges ranges) { - assert(ranges != null); + assert (ranges != null); long rangeStart = LongPoint.decodeDimension(ranges.getLower(rangeIdx), 0); rangeStart = this.getFieldType().convertNanosToMillis(rangeStart); long ord = getBucketOrds().add(0, getRoundingPrepared().round(rangeStart)); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramAggregator.java index 97a193fd62385..3f0fd562ecd39 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramAggregator.java @@ -148,7 +148,7 @@ protected long[] processHardBounds(long[] bounds) { @Override protected long getOrd(int rangeIdx, PackedValueRanges ranges) { - assert(ranges != null); + assert (ranges != null); long rangeStart = LongPoint.decodeDimension(ranges.getLower(rangeIdx), 0); rangeStart = this.getFieldType().convertNanosToMillis(rangeStart); long ord = bucketOrds.add(0, getRoundingPrepared().round(rangeStart));