use of org.apache.carbondata.core.metadata.blocklet.index.BlockletBTreeIndex in project carbondata by apache.
the class BTreeBlockFinderTest method getFileFooterWithOnlyDictionaryKey.
private DataFileFooter getFileFooterWithOnlyDictionaryKey(byte[] startKey, byte[] endKey, byte[] noDictionaryStartKey, byte[] noDictionaryEndKey) {
DataFileFooter footer = new DataFileFooter();
BlockletIndex index = new BlockletIndex();
BlockletBTreeIndex btreeIndex = new BlockletBTreeIndex();
ByteBuffer buffer = ByteBuffer.allocate(4 + startKey.length + 4 + 0);
buffer.putInt(startKey.length);
buffer.putInt(0);
buffer.put(startKey);
buffer.rewind();
btreeIndex.setStartKey(buffer.array());
ByteBuffer buffer1 = ByteBuffer.allocate(4 + 0 + 4 + noDictionaryEndKey.length);
buffer1.putInt(endKey.length);
buffer1.putInt(0);
buffer1.put(endKey);
buffer1.rewind();
btreeIndex.setEndKey(buffer1.array());
BlockletMinMaxIndex minMax = new BlockletMinMaxIndex();
minMax.setMaxValues(new byte[][] { endKey });
minMax.setMinValues(new byte[][] { startKey });
index.setBtreeIndex(btreeIndex);
index.setMinMaxIndex(minMax);
footer.setBlockletIndex(index);
return footer;
}
use of org.apache.carbondata.core.metadata.blocklet.index.BlockletBTreeIndex in project carbondata by apache.
the class BTreeBlockFinderTest method getFileFooter.
private DataFileFooter getFileFooter(byte[] startKey, byte[] endKey, byte[] noDictionaryStartKey, byte[] noDictionaryEndKey) {
DataFileFooter footer = new DataFileFooter();
BlockletIndex index = new BlockletIndex();
BlockletBTreeIndex btreeIndex = new BlockletBTreeIndex();
ByteBuffer buffer = ByteBuffer.allocate(4 + startKey.length + 4 + noDictionaryStartKey.length);
buffer.putInt(startKey.length);
buffer.putInt(noDictionaryStartKey.length);
buffer.put(startKey);
buffer.put(noDictionaryStartKey);
buffer.rewind();
btreeIndex.setStartKey(buffer.array());
ByteBuffer buffer1 = ByteBuffer.allocate(4 + startKey.length + 4 + noDictionaryEndKey.length);
buffer1.putInt(endKey.length);
buffer1.putInt(noDictionaryEndKey.length);
buffer1.put(endKey);
buffer1.put(noDictionaryEndKey);
buffer1.rewind();
btreeIndex.setEndKey(buffer1.array());
BlockletMinMaxIndex minMax = new BlockletMinMaxIndex();
minMax.setMaxValues(new byte[][] { endKey, noDictionaryEndKey });
minMax.setMinValues(new byte[][] { startKey, noDictionaryStartKey });
index.setBtreeIndex(btreeIndex);
index.setMinMaxIndex(minMax);
footer.setBlockletIndex(index);
return footer;
}
Aggregations