This is an automated email from the ASF dual-hosted git repository.
Jackie-Jiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push:
new ff069f8ca85 Make the mutable dictionary pluggable through the
dictionary index type (#19656)
ff069f8ca85 is described below
commit ff069f8ca856155ba4c3197d61d090869316c8a1
Author: Xiaotian (Jackie) Jiang <[email protected]>
AuthorDate: Fri Sep 25 11:52:46 2026 -0700
Make the mutable dictionary pluggable through the dictionary index type
(#19656)
---
.../indexsegment/mutable/MutableSegmentImpl.java | 3 +-
.../writer/impl/MutableOffHeapByteArrayStore.java | 135 ++++++++++++---------
.../dictionary/StringOffHeapMutableDictionary.java | 12 +-
.../index/dictionary/DictionaryIndexType.java | 24 ++--
.../impl/MutableOffHeapByteArrayStoreTest.java | 88 +++++++++-----
5 files changed, 159 insertions(+), 103 deletions(-)
diff --git
a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/indexsegment/mutable/MutableSegmentImpl.java
b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/indexsegment/mutable/MutableSegmentImpl.java
index 4225dfea93f..0db9174f619 100644
---
a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/indexsegment/mutable/MutableSegmentImpl.java
+++
b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/indexsegment/mutable/MutableSegmentImpl.java
@@ -382,7 +382,8 @@ public class MutableSegmentImpl implements MutableSegment {
// See isNoDictionaryColumn to have more context.
dictionaryIndexConfig = DictionaryIndexConfig.DEFAULT;
}
- dictionary = DictionaryIndexType.createMutableDictionary(context,
dictionaryIndexConfig);
+ dictionary = ((DictionaryIndexType)
StandardIndexes.dictionary()).createMutableDictionary(context,
+ dictionaryIndexConfig);
} else {
dictionary = null;
if (!fieldSpec.isSingleValueField()) {
diff --git
a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/io/writer/impl/MutableOffHeapByteArrayStore.java
b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/io/writer/impl/MutableOffHeapByteArrayStore.java
index 8a8d7c05009..d82189c0c73 100644
---
a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/io/writer/impl/MutableOffHeapByteArrayStore.java
+++
b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/io/writer/impl/MutableOffHeapByteArrayStore.java
@@ -112,14 +112,8 @@ public class MutableOffHeapByteArrayStore implements
Closeable {
}
private boolean equalsValueAt(byte[] value, int index) {
- int startOffset = _pinotDataBuffer.getInt(index * Integer.BYTES);
- int endOffset;
- if (index != 0) {
- endOffset = _pinotDataBuffer.getInt((index - 1) * Integer.BYTES);
- } else {
- endOffset = _size;
- }
- if ((endOffset - startOffset) != value.length) {
+ int startOffset = getStartOffset(index);
+ if (getEndOffset(index) - startOffset != value.length) {
return false;
}
for (int i = 0, j = startOffset; i < value.length; i++, j++) {
@@ -130,39 +124,60 @@ public class MutableOffHeapByteArrayStore implements
Closeable {
return true;
}
- private byte[] get(int index) {
- int startOffset = _pinotDataBuffer.getInt(index * Integer.BYTES);
- int endOffset;
- if (index != 0) {
- endOffset = _pinotDataBuffer.getInt((index - 1) * Integer.BYTES);
- } else {
- endOffset = _size;
+ private int compareValueAt(int index, byte[] value) {
+ int startOffset = getStartOffset(index);
+ int length = getEndOffset(index) - startOffset;
+ int commonLength = Math.min(length, value.length);
+ for (int i = 0; i < commonLength; i++) {
+ int result = Byte.compareUnsigned(_pinotDataBuffer.getByte(startOffset
+ i), value[i]);
+ if (result != 0) {
+ return result;
+ }
+ }
+ return length - value.length;
+ }
+
+ private static int compareValues(Buffer buffer1, int index1, Buffer
buffer2, int index2) {
+ PinotDataBuffer dataBuffer1 = buffer1._pinotDataBuffer;
+ PinotDataBuffer dataBuffer2 = buffer2._pinotDataBuffer;
+ int startOffset1 = buffer1.getStartOffset(index1);
+ int startOffset2 = buffer2.getStartOffset(index2);
+ int length1 = buffer1.getEndOffset(index1) - startOffset1;
+ int length2 = buffer2.getEndOffset(index2) - startOffset2;
+ int commonLength = Math.min(length1, length2);
+ for (int i = 0; i < commonLength; i++) {
+ int result = Byte.compareUnsigned(dataBuffer1.getByte(startOffset1 +
i),
+ dataBuffer2.getByte(startOffset2 + i));
+ if (result != 0) {
+ return result;
+ }
}
- byte[] value = new byte[endOffset - startOffset];
+ return length1 - length2;
+ }
+
+ private byte[] get(int index) {
+ int startOffset = getStartOffset(index);
+ byte[] value = new byte[getEndOffset(index) - startOffset];
_pinotDataBuffer.copyTo(startOffset, value);
return value;
}
private ByteBuffer getByteBuffer(int index) {
- int startOffset = _pinotDataBuffer.getInt(index * Integer.BYTES);
- int endOffset;
- if (index != 0) {
- endOffset = _pinotDataBuffer.getInt((index - 1) * Integer.BYTES);
- } else {
- endOffset = _size;
- }
- return _pinotDataBuffer.toDirectByteBuffer(startOffset, endOffset -
startOffset);
+ int startOffset = getStartOffset(index);
+ return _pinotDataBuffer.toDirectByteBuffer(startOffset,
getEndOffset(index) - startOffset);
}
private int getValueSize(int index) {
- int startOffset = _pinotDataBuffer.getInt(index * Integer.BYTES);
- int endOffset;
- if (index != 0) {
- endOffset = _pinotDataBuffer.getInt((index - 1) * Integer.BYTES);
- } else {
- endOffset = _size;
- }
- return endOffset - startOffset;
+ return getEndOffset(index) - getStartOffset(index);
+ }
+
+ private int getStartOffset(int index) {
+ return _pinotDataBuffer.getInt(index * Integer.BYTES);
+ }
+
+ // The values are stored from the end of the buffer towards the start, so
a value ends where the previous one starts
+ private int getEndOffset(int index) {
+ return index != 0 ? _pinotDataBuffer.getInt((index - 1) * Integer.BYTES)
: _size;
}
private int getSize() {
@@ -222,40 +237,20 @@ public class MutableOffHeapByteArrayStore implements
Closeable {
// Returns a byte array, given an index
public byte[] get(int index) {
- List<Buffer> bufList = _buffers;
- for (int x = bufList.size() - 1; x >= 0; x--) {
- Buffer buffer = bufList.get(x);
- if (index >= buffer.getStartIndex()) {
- return buffer.get(index - buffer.getStartIndex());
- }
- }
- // Assumed that we will never ask for an index that does not exist.
- throw new RuntimeException("dictionary ID '" + index + "' too low");
+ Buffer buffer = getBuffer(index);
+ return buffer.get(index - buffer.getStartIndex());
}
/// Returns a read-only view of the value at the given index without copying
it.
/// The returned buffer must not be used after this store is closed.
public ByteBuffer getByteBuffer(int index) {
- List<Buffer> bufList = _buffers;
- for (int x = bufList.size() - 1; x >= 0; x--) {
- Buffer buffer = bufList.get(x);
- if (index >= buffer.getStartIndex()) {
- return buffer.getByteBuffer(index -
buffer.getStartIndex()).asReadOnlyBuffer();
- }
- }
- throw new RuntimeException("dictionary ID '" + index + "' too low");
+ Buffer buffer = getBuffer(index);
+ return buffer.getByteBuffer(index -
buffer.getStartIndex()).asReadOnlyBuffer();
}
public int getValueSize(int index) {
- List<Buffer> bufList = _buffers;
- for (int x = bufList.size() - 1; x >= 0; x--) {
- Buffer buffer = bufList.get(x);
- if (index >= buffer.getStartIndex()) {
- return buffer.getValueSize(index - buffer.getStartIndex());
- }
- }
- // Assumed that we will never ask for an index that does not exist.
- throw new RuntimeException("dictionary ID '" + index + "' too low");
+ Buffer buffer = getBuffer(index);
+ return buffer.getValueSize(index - buffer.getStartIndex());
}
// Adds a byte array and returns the index. No verification is made as to
whether the byte array already exists or not
@@ -281,11 +276,33 @@ public class MutableOffHeapByteArrayStore implements
Closeable {
}
public boolean equalsValueAt(byte[] value, int index) {
+ Buffer buffer = getBuffer(index);
+ return buffer.equalsValueAt(value, index - buffer.getStartIndex());
+ }
+
+ /// Compares the value at the given index with the given value in unsigned
lexicographic byte order, and returns a
+ /// negative integer, zero, or a positive integer as the stored value is
less than, equal to, or greater than the
+ /// given value.
+ public int compareValueAt(int index, byte[] value) {
+ Buffer buffer = getBuffer(index);
+ return buffer.compareValueAt(index - buffer.getStartIndex(), value);
+ }
+
+ /// Compares the values at the given indexes in unsigned lexicographic byte
order, and returns a negative integer,
+ /// zero, or a positive integer as the first value is less than, equal to,
or greater than the second one.
+ public int compareValues(int index1, int index2) {
+ Buffer buffer1 = getBuffer(index1);
+ Buffer buffer2 = getBuffer(index2);
+ return Buffer.compareValues(buffer1, index1 - buffer1.getStartIndex(),
buffer2, index2 - buffer2.getStartIndex());
+ }
+
+ /// Returns the buffer holding the value at the given index. The index is
assumed to exist.
+ private Buffer getBuffer(int index) {
List<Buffer> bufList = _buffers;
for (int x = bufList.size() - 1; x >= 0; x--) {
Buffer buffer = bufList.get(x);
if (index >= buffer.getStartIndex()) {
- return buffer.equalsValueAt(value, index - buffer.getStartIndex());
+ return buffer;
}
}
throw new RuntimeException("dictionary ID '" + index + "' too low");
diff --git
a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/realtime/impl/dictionary/StringOffHeapMutableDictionary.java
b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/realtime/impl/dictionary/StringOffHeapMutableDictionary.java
index 5bf23fe3ce6..abe52c66fc6 100644
---
a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/realtime/impl/dictionary/StringOffHeapMutableDictionary.java
+++
b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/realtime/impl/dictionary/StringOffHeapMutableDictionary.java
@@ -33,13 +33,13 @@ import org.apache.pinot.spi.utils.Utf8Utils;
@SuppressWarnings("Duplicates")
public class StringOffHeapMutableDictionary extends
BaseOffHeapMutableDictionary {
- private final MutableOffHeapByteArrayStore _byteStore;
+ protected final MutableOffHeapByteArrayStore _byteStore;
- private volatile String _min = null;
- private volatile String _max = null;
- private volatile int _lengthOfShortestElement = Integer.MAX_VALUE;
- private volatile int _lengthOfLongestElement = 0;
- private volatile boolean _isAscii = true;
+ protected volatile String _min = null;
+ protected volatile String _max = null;
+ protected volatile int _lengthOfShortestElement = Integer.MAX_VALUE;
+ protected volatile int _lengthOfLongestElement = 0;
+ protected volatile boolean _isAscii = true;
public StringOffHeapMutableDictionary(int estimatedCardinality, int
maxOverflowHashSize,
PinotDataBufferMemoryManager memoryManager, String allocationContext,
int avgStringLen) {
diff --git
a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/dictionary/DictionaryIndexType.java
b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/dictionary/DictionaryIndexType.java
index ab0f76d8b15..e0f9256c44f 100644
---
a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/dictionary/DictionaryIndexType.java
+++
b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/dictionary/DictionaryIndexType.java
@@ -71,6 +71,7 @@ import
org.apache.pinot.segment.spi.index.mutable.MutableDictionary;
import org.apache.pinot.segment.spi.index.mutable.provider.MutableIndexContext;
import org.apache.pinot.segment.spi.index.reader.Dictionary;
import org.apache.pinot.segment.spi.memory.PinotDataBuffer;
+import org.apache.pinot.segment.spi.memory.PinotDataBufferMemoryManager;
import org.apache.pinot.segment.spi.store.SegmentDirectory;
import org.apache.pinot.spi.config.table.FieldConfig;
import org.apache.pinot.spi.config.table.IndexingConfig;
@@ -561,15 +562,16 @@ public class DictionaryIndexType
/// Creates a MutableDictionary.
///
- /// Unlikes most indexes, while dictionaries are important when
+ /// Unlike most indexes, while dictionaries are important when
/// [`mutable segments`]\[org.apache.pinot.segment.spi.MutableSegment\] are
created, they do not follow the
/// [org.apache.pinot.segment.spi.index.mutable.MutableIndex] interface and
therefore
/// [DictionaryIndexType#createMutableIndex(MutableIndexContext,
org.apache.pinot.spi.config.table.IndexConfig)]
- /// is not implemented.
- ///
- /// This also means that dictionaries cannot be overridden in realtime
tables.
+ /// is not implemented. Mutable segments create their dictionaries through
this method on the dictionary index type
+ /// registered in [IndexService] instead, so a plugin that overrides the
dictionary index type can override
+ /// [#createMutableDictionary(DataType, boolean,
PinotDataBufferMemoryManager, int, int, String)] to substitute its
+ /// own implementation for some of the stored types.
@Nullable
- public static MutableDictionary createMutableDictionary(MutableIndexContext
context, DictionaryIndexConfig config) {
+ public MutableDictionary createMutableDictionary(MutableIndexContext
context, DictionaryIndexConfig config) {
if (config.isDisabled()) {
return null;
}
@@ -589,8 +591,16 @@ public class DictionaryIndexType
int estimatedCardinality = (int) (context.getEstimatedCardinality() *
1.21);
String dictionaryAllocationContext =
IndexUtil.buildAllocationContext(segmentName, column,
V1Constants.Dict.FILE_EXTENSION);
- return MutableDictionaryFactory.getMutableDictionary(storedType,
context.isOffHeap(), context.getMemoryManager(),
- dictionaryColumnSize, Math.min(estimatedCardinality,
context.getCapacity()), dictionaryAllocationContext);
+ return createMutableDictionary(storedType, context.isOffHeap(),
context.getMemoryManager(), dictionaryColumnSize,
+ Math.min(estimatedCardinality, context.getCapacity()),
dictionaryAllocationContext);
+ }
+
+ /// Creates the mutable dictionary for the given stored type and sizing
hints. Override to substitute a different
+ /// implementation for some of the stored types, and delegate to `super` for
the rest.
+ protected MutableDictionary createMutableDictionary(DataType storedType,
boolean offHeap,
+ PinotDataBufferMemoryManager memoryManager, int avgLength, int
cardinality, String allocationContext) {
+ return MutableDictionaryFactory.getMutableDictionary(storedType, offHeap,
memoryManager, avgLength, cardinality,
+ allocationContext);
}
public BuildLifecycle getIndexBuildLifecycle() {
diff --git
a/pinot-segment-local/src/test/java/org/apache/pinot/segment/local/io/writer/impl/MutableOffHeapByteArrayStoreTest.java
b/pinot-segment-local/src/test/java/org/apache/pinot/segment/local/io/writer/impl/MutableOffHeapByteArrayStoreTest.java
index e817598ce3b..f3b58abf226 100644
---
a/pinot-segment-local/src/test/java/org/apache/pinot/segment/local/io/writer/impl/MutableOffHeapByteArrayStoreTest.java
+++
b/pinot-segment-local/src/test/java/org/apache/pinot/segment/local/io/writer/impl/MutableOffHeapByteArrayStoreTest.java
@@ -29,11 +29,14 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.pinot.segment.local.PinotBuffersAfterClassCheckRule;
import org.apache.pinot.segment.spi.memory.PinotDataBufferMemoryManager;
-import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertThrows;
+import static org.testng.Assert.assertTrue;
+
public class MutableOffHeapByteArrayStoreTest implements
PinotBuffersAfterClassCheckRule {
@@ -65,15 +68,14 @@ public class MutableOffHeapByteArrayStoreTest implements
PinotBuffersAfterClassC
}
int index = store.add(dataIn);
byte[] dataOut = store.get(index);
- Assert.assertTrue(Arrays.equals(dataIn, dataOut));
+ assertTrue(Arrays.equals(dataIn, dataOut));
}
}
@Test
public void byteBufferTest()
throws Exception {
- try (MutableOffHeapByteArrayStore store =
- new MutableOffHeapByteArrayStore(_memoryManager, "bytesColumn", 1, 1))
{
+ try (MutableOffHeapByteArrayStore store = new
MutableOffHeapByteArrayStore(_memoryManager, "bytesColumn", 1, 1)) {
byte[] firstValue = {1};
byte[] secondValue = {2, 3, 4};
int firstIndex = store.add(firstValue);
@@ -82,14 +84,40 @@ public class MutableOffHeapByteArrayStoreTest implements
PinotBuffersAfterClassC
ByteBuffer firstBuffer = store.getByteBuffer(firstIndex);
byte[] firstResult = new byte[firstBuffer.remaining()];
firstBuffer.get(firstResult);
- Assert.assertEquals(firstResult, firstValue);
+ assertEquals(firstResult, firstValue);
ByteBuffer secondBuffer = store.getByteBuffer(secondIndex);
- Assert.assertTrue(secondBuffer.isReadOnly());
+ assertTrue(secondBuffer.isReadOnly());
byte[] secondResult = new byte[secondBuffer.remaining()];
secondBuffer.get(secondResult);
- Assert.assertEquals(secondResult, secondValue);
- Assert.assertThrows(ReadOnlyBufferException.class, () ->
store.getByteBuffer(secondIndex).put((byte) 0));
+ assertEquals(secondResult, secondValue);
+ assertThrows(ReadOnlyBufferException.class, () ->
store.getByteBuffer(secondIndex).put((byte) 0));
+ }
+ }
+
+ @Test
+ public void compareTest()
+ throws Exception {
+ // Start with a tiny buffer so that the values spread across multiple
buffers
+ try (MutableOffHeapByteArrayStore store = new
MutableOffHeapByteArrayStore(_memoryManager, "stringColumn", 1, 1)) {
+ // Values in ascending unsigned lexicographic order
+ byte[][] values = {{}, {1}, {1, 2}, {1, 2, 3}, {2}, {(byte) 0x80},
{(byte) 0xFF}};
+ int numValues = values.length;
+ int[] indexes = new int[numValues];
+ for (int i = 0; i < numValues; i++) {
+ indexes[i] = store.add(values[i]);
+ }
+ for (int i = 0; i < numValues; i++) {
+ for (int j = 0; j < numValues; j++) {
+ int expected = Integer.compare(i, j);
+ assertEquals(Integer.signum(store.compareValues(indexes[i],
indexes[j])), expected);
+ assertEquals(Integer.signum(store.compareValueAt(indexes[i],
values[j])), expected);
+ }
+ }
+ // A value that is not in the store sorts between its neighbors
+ byte[] absentValue = {1, 2, 2};
+ assertTrue(store.compareValueAt(indexes[2], absentValue) < 0);
+ assertTrue(store.compareValueAt(indexes[3], absentValue) > 0);
}
}
@@ -106,11 +134,11 @@ public class MutableOffHeapByteArrayStoreTest implements
PinotBuffersAfterClassC
new MutableOffHeapByteArrayStore(_memoryManager,
"concurrentBytesColumn", 1, 1)) {
Future<?> writer = executor.submit(() -> {
await(start);
- Assert.assertEquals(store.add(valueForIndex(0)), 0);
+ assertEquals(store.add(valueForIndex(0)), 0);
publishedCount.set(1);
await(firstValueRead);
for (int i = 1; i < numValues; i++) {
- Assert.assertEquals(store.add(valueForIndex(i)), i);
+ assertEquals(store.add(valueForIndex(i)), i);
// Publish only after the value and any expanded buffer are visible
to readers.
publishedCount.set(i + 1);
}
@@ -125,10 +153,10 @@ public class MutableOffHeapByteArrayStoreTest implements
PinotBuffersAfterClassC
int readableCount = publishedCount.get();
while (nextIndex < readableCount) {
ByteBuffer byteBuffer = store.getByteBuffer(nextIndex);
- Assert.assertTrue(byteBuffer.isReadOnly());
+ assertTrue(byteBuffer.isReadOnly());
byte[] actual = new byte[byteBuffer.remaining()];
byteBuffer.get(actual);
- Assert.assertEquals(actual, valueForIndex(nextIndex));
+ assertEquals(actual, valueForIndex(nextIndex));
nextIndex++;
if (nextIndex == 1) {
firstValueRead.countDown();
@@ -146,7 +174,7 @@ public class MutableOffHeapByteArrayStoreTest implements
PinotBuffersAfterClassC
}
} finally {
executor.shutdownNow();
- Assert.assertTrue(executor.awaitTermination(30, TimeUnit.SECONDS));
+ assertTrue(executor.awaitTermination(30, TimeUnit.SECONDS));
}
}
@@ -156,7 +184,7 @@ public class MutableOffHeapByteArrayStoreTest implements
PinotBuffersAfterClassC
private static void await(CountDownLatch latch) {
try {
- Assert.assertTrue(latch.await(30, TimeUnit.SECONDS));
+ assertTrue(latch.await(30, TimeUnit.SECONDS));
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
@@ -165,9 +193,9 @@ public class MutableOffHeapByteArrayStoreTest implements
PinotBuffersAfterClassC
@Test
public void startSizeTest() {
- Assert.assertEquals(MutableOffHeapByteArrayStore.getStartSize(1, ONE_GB),
ONE_GB + 4);
- Assert.assertEquals(MutableOffHeapByteArrayStore.getStartSize(3, ONE_GB),
Integer.MAX_VALUE);
- Assert.assertEquals(MutableOffHeapByteArrayStore.getStartSize(5, ONE_GB),
Integer.MAX_VALUE);
+ assertEquals(MutableOffHeapByteArrayStore.getStartSize(1, ONE_GB), ONE_GB
+ 4);
+ assertEquals(MutableOffHeapByteArrayStore.getStartSize(3, ONE_GB),
Integer.MAX_VALUE);
+ assertEquals(MutableOffHeapByteArrayStore.getStartSize(5, ONE_GB),
Integer.MAX_VALUE);
}
@Test
@@ -191,25 +219,25 @@ public class MutableOffHeapByteArrayStoreTest implements
PinotBuffersAfterClassC
// Add small array
final int i1 = store.add(b1);
- Assert.assertTrue(Arrays.equals(store.get(i1), b1));
+ assertTrue(Arrays.equals(store.get(i1), b1));
// And now the larger one, should result in a new buffer
final int i2 = store.add(b2);
- Assert.assertTrue(Arrays.equals(store.get(i2), b2));
+ assertTrue(Arrays.equals(store.get(i2), b2));
// And now one more, should result in a new buffer but exact fit.
final int i3 = store.add(b2);
- Assert.assertTrue(Arrays.equals(store.get(i3), b2));
+ assertTrue(Arrays.equals(store.get(i3), b2));
// One more buffer when we add the small one again.
final int i4 = store.add(b1);
- Assert.assertTrue(Arrays.equals(store.get(i4), b1));
+ assertTrue(Arrays.equals(store.get(i4), b1));
// Test with one more 'get' to ensure that things have not changed.
- Assert.assertTrue(Arrays.equals(store.get(i1), b1));
- Assert.assertTrue(Arrays.equals(store.get(i2), b2));
- Assert.assertTrue(Arrays.equals(store.get(i3), b2));
- Assert.assertTrue(Arrays.equals(store.get(i4), b1));
+ assertTrue(Arrays.equals(store.get(i1), b1));
+ assertTrue(Arrays.equals(store.get(i2), b2));
+ assertTrue(Arrays.equals(store.get(i3), b2));
+ assertTrue(Arrays.equals(store.get(i4), b1));
byte[] b3 = new byte[5];
for (int i = 0; i < b3.length; i++) {
@@ -227,14 +255,14 @@ public class MutableOffHeapByteArrayStoreTest implements
PinotBuffersAfterClassC
store.add(b3);
}
for (int i = 0; i < iters; i++) {
- Assert.assertTrue(Arrays.equals(store.get(ix++), b3));
+ assertTrue(Arrays.equals(store.get(ix++), b3));
}
// Original values should still be good.
- Assert.assertTrue(Arrays.equals(store.get(i1), b1));
- Assert.assertTrue(Arrays.equals(store.get(i2), b2));
- Assert.assertTrue(Arrays.equals(store.get(i3), b2));
- Assert.assertTrue(Arrays.equals(store.get(i4), b1));
+ assertTrue(Arrays.equals(store.get(i1), b1));
+ assertTrue(Arrays.equals(store.get(i2), b2));
+ assertTrue(Arrays.equals(store.get(i3), b2));
+ assertTrue(Arrays.equals(store.get(i4), b1));
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]