Skip to content

Commit 00b833f

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent 41363bd commit 00b833f

File tree

7 files changed

+32
-26
lines changed

7 files changed

+32
-26
lines changed

benchmarks/src/main/java/org/elasticsearch/benchmark/common/compress/FSSTCompressBenchmark.java

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public static class CompressionMetrics {
4848
}
4949

5050
private static final int MB_8 = 8 * 1024 * 1024;
51+
5152
private byte[] concatenateTo8mb(byte[] contentBytes) {
5253
byte[] bytes = new byte[MB_8 + 8];
5354
int i = 0;
@@ -66,7 +67,7 @@ public void setup() throws IOException {
6667

6768
byte[] contentBytes = FSST.toBytes(content);
6869
input = concatenateTo8mb(contentBytes);
69-
offsets = new int[]{0, MB_8};
70+
offsets = new int[] { 0, MB_8 };
7071
outBuf = new byte[MB_8];
7172
outOffsets = new int[2];
7273
}
@@ -100,19 +101,19 @@ public void compressLZ4Fast(Blackhole bh, CompressionMetrics metrics) throws IOE
100101
metrics.compressionRatio = compressedSize / (double) inputSize;
101102
}
102103

103-
// @Benchmark
104-
// public void compressLZ4High(Blackhole bh, CompressionMetrics metrics) throws IOException {
105-
// int inputSize = offsets[1];
106-
//
107-
// var dataInput = new ByteBuffersDataInput(List.of(ByteBuffer.wrap(input)));
108-
// var dataOutput = new ByteArrayDataOutput(outBuf);
109-
//
110-
// Compressor compressor = CompressionMode.HIGH_COMPRESSION.newCompressor();
111-
// compressor.compress(dataInput, dataOutput);
112-
//
113-
// long compressedSize = dataOutput.getPosition();
114-
// bh.consume(dataOutput);
115-
//
116-
// metrics.compressionRatio = compressedSize / (double) inputSize;
117-
// }
104+
// @Benchmark
105+
// public void compressLZ4High(Blackhole bh, CompressionMetrics metrics) throws IOException {
106+
// int inputSize = offsets[1];
107+
//
108+
// var dataInput = new ByteBuffersDataInput(List.of(ByteBuffer.wrap(input)));
109+
// var dataOutput = new ByteArrayDataOutput(outBuf);
110+
//
111+
// Compressor compressor = CompressionMode.HIGH_COMPRESSION.newCompressor();
112+
// compressor.compress(dataInput, dataOutput);
113+
//
114+
// long compressedSize = dataOutput.getPosition();
115+
// bh.consume(dataOutput);
116+
//
117+
// metrics.compressionRatio = compressedSize / (double) inputSize;
118+
// }
118119
}

benchmarks/src/main/java/org/elasticsearch/benchmark/common/compress/FSSTDecompressBenchmark.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import java.nio.charset.StandardCharsets;
2626
import java.nio.file.Files;
2727
import java.nio.file.Path;
28-
import java.util.Arrays;
2928
import java.util.List;
3029
import java.util.concurrent.TimeUnit;
3130

@@ -37,8 +36,8 @@
3736
@State(Scope.Benchmark)
3837
public class FSSTDecompressBenchmark {
3938

40-
// @Param({ "fsst", "lz4_high", "lz4_fast" })
41-
@Param({"fsst", "lz4_fast"})
39+
// @Param({ "fsst", "lz4_high", "lz4_fast" })
40+
@Param({ "fsst", "lz4_fast" })
4241
public String compressionType;
4342

4443
@Param("")
@@ -61,6 +60,7 @@ public class FSSTDecompressBenchmark {
6160
private FSST.SymbolTable symbolTable;
6261

6362
private static final int MB_8 = 8 * 1024 * 1024;
63+
6464
private byte[] concatenateTo8mb(byte[] contentBytes) {
6565
byte[] bytes = new byte[MB_8 + 8];
6666
int i = 0;
@@ -79,7 +79,7 @@ public void setup() throws IOException {
7979
byte[] contentBytes = FSST.toBytes(content);
8080
originalSize = MB_8;
8181
input = concatenateTo8mb(contentBytes);
82-
offsets = new int[]{0, originalSize};
82+
offsets = new int[] { 0, originalSize };
8383

8484
outBuf = new byte[input.length];
8585
outOffsets = new int[2];

server/src/main/java/org/elasticsearch/common/compress/fsst/BulkCompressBufferer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private void compressAndWriteBuffer() throws IOException {
104104

105105
finalOutput.writeBytes(outBuf, 0, (int) fullOutLen);
106106
for (int i = 0; i < numLines; ++i) {
107-
int len = outOffsets[i+1] - outOffsets[i];
107+
int len = outOffsets[i + 1] - outOffsets[i];
108108
offsetWriter.addLen(len);
109109
}
110110

server/src/main/java/org/elasticsearch/index/codec/tsdb/es819/ES819TSDBDocValuesConsumer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
import org.elasticsearch.index.codec.tsdb.BinaryDVCompressionMode;
4848
import org.elasticsearch.index.codec.tsdb.TSDBDocValuesEncoder;
4949

50-
import java.io.Closeable;
5150
import java.io.IOException;
5251
import java.util.ArrayList;
5352
import java.util.Arrays;

server/src/main/java/org/elasticsearch/index/codec/tsdb/es819/ES819TSDBDocValuesFormat.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ public ES819TSDBDocValuesFormat(BinaryDVCompressionMode binaryDVCompressionMode)
120120
}
121121

122122
/** Doc values fields format with specified skipIndexIntervalSize. */
123-
public ES819TSDBDocValuesFormat(int skipIndexIntervalSize, boolean enableOptimizedMerge, BinaryDVCompressionMode binaryDVCompressionMode) {
123+
public ES819TSDBDocValuesFormat(
124+
int skipIndexIntervalSize,
125+
boolean enableOptimizedMerge,
126+
BinaryDVCompressionMode binaryDVCompressionMode
127+
) {
124128
super(CODEC_NAME);
125129
if (skipIndexIntervalSize < 2) {
126130
throw new IllegalArgumentException("skipIndexIntervalSize must be > 1, got [" + skipIndexIntervalSize + "]");

server/src/main/java/org/elasticsearch/index/codec/tsdb/es819/ES819TSDBDocValuesProducer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ public NumericDocValues getNumeric(FieldInfo field) throws IOException {
177177
return getNumeric(entry, -1);
178178
}
179179

180-
181180
@Override
182181
public BinaryDocValues getBinary(FieldInfo field) throws IOException {
183182
BinaryEntry entry = binaries.get(field.number);
@@ -280,6 +279,7 @@ public BinaryDocValues getCompressedBinaryFSST(BinaryEntry entry) throws IOExcep
280279
return new DenseBinaryDocValues(maxDoc) {
281280
final BytesRef inBuf = new BytesRef(new byte[maxCompressedLength], 0, maxCompressedLength);
282281
final BytesRef outBuf = new BytesRef(new byte[lengthToAllocate], 0, lengthToAllocate);
282+
283283
@Override
284284
public BytesRef binaryValue() throws IOException {
285285
bytesSlice.readBytes((long) doc * maxCompressedLength, inBuf.bytes, 0, maxCompressedLength);
@@ -335,6 +335,7 @@ public BytesRef binaryValue() throws IOException {
335335
return new SparseBinaryDocValues(disi) {
336336
final BytesRef inBuf = new BytesRef(new byte[maxCompressedLength], 0, 0);
337337
final BytesRef outBuf = new BytesRef(new byte[lengthToAllocate], 0, lengthToAllocate);
338+
338339
@Override
339340
public BytesRef binaryValue() throws IOException {
340341
final int index = disi.index();
@@ -1584,7 +1585,6 @@ static class BinaryEntry {
15841585
int maxCompressedLength;
15851586
FSST.Decoder decoder;
15861587

1587-
15881588
private BinaryEntry(BinaryDVCompressionMode compression) {
15891589
this.compression = compression;
15901590
}

server/src/test/java/org/elasticsearch/index/codec/tsdb/es819/ES819TSDBDocValuesFormatVariableSkipIntervalTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ public class ES819TSDBDocValuesFormatVariableSkipIntervalTests extends ES87TSDBD
1919
protected Codec getCodec() {
2020
var compressionMode = ES819TSDBDocValuesFormatTests.randomBinaryDVCompressionMode(random());
2121
// small interval size to test with many intervals
22-
return TestUtil.alwaysDocValuesFormat(new ES819TSDBDocValuesFormat(random().nextInt(4, 16), random().nextBoolean(), compressionMode));
22+
return TestUtil.alwaysDocValuesFormat(
23+
new ES819TSDBDocValuesFormat(random().nextInt(4, 16), random().nextBoolean(), compressionMode)
24+
);
2325
}
2426

2527
public void testSkipIndexIntervalSize() {

0 commit comments

Comments
 (0)