Skip to content

Commit b991e5b

Browse files
committed
spotless
1 parent 1857b63 commit b991e5b

File tree

18 files changed

+35
-28
lines changed

18 files changed

+35
-28
lines changed

libs/exponential-histogram/src/main/java/module-info.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@
2121
requires org.elasticsearch.xcontent;
2222
requires org.apache.lucene.core;
2323
requires org.elasticsearch.base;
24+
2425
exports org.elasticsearch.exponentialhistogram;
2526
}

libs/exponential-histogram/src/main/java/org/elasticsearch/exponentialhistogram/ExponentialHistogram.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ static int hashCode(ExponentialHistogram histogram) {
201201
// the value count is typically available as a cached value and doesn't involve iterating over all buckets
202202
return hash;
203203
}
204+
204205
/**
205206
* Default toString implementation for exponential histograms.
206207
* @param histogram the histogram to convert to string
@@ -232,7 +233,7 @@ static String toString(ExponentialHistogram histogram) {
232233
sb.append("]");
233234
}
234235
sb.append("}");
235-
return sb.toString();
236+
return sb.toString();
236237
}
237238

238239
private static void appendsBucketsAsString(StringBuilder out, BucketIterator it) {

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/BlockUtils.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ private static Block constantBlock(BlockFactory blockFactory, ElementType type,
249249
case BOOLEAN -> blockFactory.newConstantBooleanBlockWith((boolean) val, size);
250250
case AGGREGATE_METRIC_DOUBLE -> blockFactory.newConstantAggregateMetricDoubleBlock((AggregateMetricDoubleLiteral) val, size);
251251
case FLOAT -> blockFactory.newConstantFloatBlockWith((float) val, size);
252-
case EXPONENTIAL_HISTOGRAM -> blockFactory.newConstantExponentialHistogramBlock((ExponentialHistogram) val, size);
252+
case EXPONENTIAL_HISTOGRAM -> blockFactory.newConstantExponentialHistogramBlock((ExponentialHistogram) val, size);
253253
default -> throw new UnsupportedOperationException("unsupported element type [" + type + "]");
254254
};
255255
}
@@ -303,7 +303,8 @@ yield new AggregateMetricDoubleLiteral(
303303
aggBlock.countBlock().getInt(offset)
304304
);
305305
}
306-
case EXPONENTIAL_HISTOGRAM -> ExponentialHistogram.merge( //TODO: do a cleaner copy with builder here
306+
case EXPONENTIAL_HISTOGRAM -> ExponentialHistogram.merge(
307+
// TODO: do a cleaner copy with builder here
307308
100,
308309
ExponentialHistogramCircuitBreaker.noop(),
309310
((ExponentialHistogramArrayBlock) block).getExponentialHistogram(offset)

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/ExponentialHistogramArrayBlock.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
package org.elasticsearch.compute.data;
99

1010
import org.apache.lucene.util.BytesRef;
11-
import org.apache.lucene.util.RamUsageEstimator;
1211
import org.elasticsearch.common.io.stream.StreamOutput;
1312
import org.elasticsearch.common.unit.ByteSizeValue;
1413
import org.elasticsearch.core.ReleasableIterator;

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/data/BlockBuilderCopyFromTests.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ public class BlockBuilderCopyFromTests extends ESTestCase {
2727
public static List<Object[]> params() {
2828
List<Object[]> params = new ArrayList<>();
2929
for (ElementType e : ElementType.values()) {
30-
if (e == ElementType.UNKNOWN || e == ElementType.NULL || e == ElementType.DOC || e == ElementType.COMPOSITE || e == ElementType.EXPONENTIAL_HISTOGRAM) {
30+
if (e == ElementType.UNKNOWN
31+
|| e == ElementType.NULL
32+
|| e == ElementType.DOC
33+
|| e == ElementType.COMPOSITE
34+
|| e == ElementType.EXPONENTIAL_HISTOGRAM) {
3135
continue;
3236
}
3337
for (boolean nullAllowed : new boolean[] { false, true }) {

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/data/BlockBuilderTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public void testCrankyConstantBlock() {
184184
builder.copyFrom(random.block(), 0, random.block().getPositionCount());
185185
try (Block built = builder.build()) {
186186
Vector vector = built.asVector();
187-
if (vector != null) { //some types don't support vectors, e.g. AggregateMetricDouble and ExponentialHistogram
187+
if (vector != null) { // some types don't support vectors, e.g. AggregateMetricDouble and ExponentialHistogram
188188
assertThat(vector.isConstant(), is(true));
189189
}
190190
assertThat(built, equalTo(random.block()));

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/data/CompositeBlockTests.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ public class CompositeBlockTests extends ComputeTestCase {
2121

2222
static List<ElementType> supportedSubElementTypes = Arrays.stream(ElementType.values())
2323
.filter(
24-
e -> e != ElementType.COMPOSITE && e != ElementType.UNKNOWN && e != ElementType.DOC && e != ElementType.AGGREGATE_METRIC_DOUBLE&& e != ElementType.EXPONENTIAL_HISTOGRAM
24+
e -> e != ElementType.COMPOSITE
25+
&& e != ElementType.UNKNOWN
26+
&& e != ElementType.DOC
27+
&& e != ElementType.AGGREGATE_METRIC_DOUBLE
28+
&& e != ElementType.EXPONENTIAL_HISTOGRAM
2529
)
2630
.toList();
2731

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/topn/TopNOperatorTests.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,11 @@ public void testRandomMultiValuesTopN() {
10251025

10261026
for (int type = 0; type < blocksCount; type++) {
10271027
ElementType e = randomValueOtherThanMany(
1028-
t -> t == ElementType.UNKNOWN || t == ElementType.DOC || t == COMPOSITE || t == AGGREGATE_METRIC_DOUBLE || t == EXPONENTIAL_HISTOGRAM,
1028+
t -> t == ElementType.UNKNOWN
1029+
|| t == ElementType.DOC
1030+
|| t == COMPOSITE
1031+
|| t == AGGREGATE_METRIC_DOUBLE
1032+
|| t == EXPONENTIAL_HISTOGRAM,
10291033
() -> randomFrom(ElementType.values())
10301034
);
10311035
elementTypes.add(e);

x-pack/plugin/esql/compute/test/src/main/java/org/elasticsearch/compute/test/RandomBlock.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import org.elasticsearch.compute.data.IntBlock;
2121
import org.elasticsearch.compute.data.LongBlock;
2222
import org.elasticsearch.exponentialhistogram.ExponentialHistogram;
23-
import org.elasticsearch.exponentialhistogram.ExponentialHistogramCircuitBreaker;
2423
import org.elasticsearch.geo.GeometryTestUtils;
2524
import org.elasticsearch.geo.ShapeTestUtils;
2625
import org.elasticsearch.geometry.Point;

x-pack/plugin/esql/qa/testFixtures/src/main/java/org/elasticsearch/xpack/esql/CsvAssert.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
import org.elasticsearch.common.time.DateFormatter;
1313
import org.elasticsearch.compute.data.AggregateMetricDoubleBlockBuilder;
1414
import org.elasticsearch.compute.data.Page;
15+
import org.elasticsearch.exponentialhistogram.ExponentialHistogram;
1516
import org.elasticsearch.geometry.utils.Geohash;
1617
import org.elasticsearch.h3.H3;
17-
import org.elasticsearch.exponentialhistogram.ExponentialHistogram;
1818
import org.elasticsearch.logging.Logger;
1919
import org.elasticsearch.search.DocValueFormat;
2020
import org.elasticsearch.search.aggregations.bucket.geogrid.GeoTileUtils;

0 commit comments

Comments
 (0)