Skip to content

Commit a440693

Browse files
fix: enable assertions
1 parent ea93f90 commit a440693

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

server/src/main/java/org/elasticsearch/index/codec/tsdb/TSDBDocValuesEncoder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ private void forEncode(int token, int tokenBits, long[] in, DataOutput out) thro
176176
* Encode the given longs using a combination of delta-coding, GCD factorization and bit packing.
177177
*/
178178
void encode(long[] in, DataOutput out) throws IOException {
179-
// assert in.length == numericBlockSize;
179+
assert in.length == numericBlockSize;
180180

181181
deltaEncode(0, 0, in, out);
182182
}
@@ -194,7 +194,7 @@ void encode(long[] in, DataOutput out) throws IOException {
194194
* </ul>
195195
*/
196196
void encodeOrdinals(long[] in, DataOutput out, int bitsPerOrd) throws IOException {
197-
// assert in.length == numericBlockSize;
197+
assert in.length == numericBlockSize;
198198
int numRuns = 1;
199199
long firstValue = in[0];
200200
long previousValue = firstValue;
@@ -261,7 +261,7 @@ void encodeOrdinals(long[] in, DataOutput out, int bitsPerOrd) throws IOExceptio
261261
}
262262

263263
void decodeOrdinals(DataInput in, long[] out, int bitsPerOrd) throws IOException {
264-
// assert out.length == numericBlockSize : out.length;
264+
assert out.length == numericBlockSize : out.length;
265265

266266
long v1 = in.readVLong();
267267
int encoding = Long.numberOfTrailingZeros(~v1);
@@ -295,7 +295,7 @@ void decodeOrdinals(DataInput in, long[] out, int bitsPerOrd) throws IOException
295295

296296
/** Decode longs that have been encoded with {@link #encode}. */
297297
void decode(DataInput in, long[] out) throws IOException {
298-
// assert out.length == numericBlockSize : out.length;
298+
assert out.length == numericBlockSize : out.length;
299299

300300
final int token = in.readVInt();
301301
final int bitsPerValue = token >>> 3;

0 commit comments

Comments
 (0)