static class HFileBlockIndex.ByteArrayKeyBlockIndexReader extends HFileBlockIndex.BlockIndexReader
| Modifier and Type | Field and Description |
|---|---|
private byte[][] |
blockKeys |
blockDataSizes, blockOffsets, midKeyEntry, midLeafBlockOffset, midLeafBlockOnDiskSize, rootCount, searchTreeLevel| Constructor and Description |
|---|
ByteArrayKeyBlockIndexReader(int treeLevel) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
add(byte[] key,
long offset,
int dataSize) |
protected long |
calculateHeapSizeForBlockKeys(long heapSize) |
byte[] |
getRootBlockKey(int i)
n * from 0 to
- 1 |
protected void |
initialize(int numEntries) |
boolean |
isEmpty()
Returns true if the block index is empty.
|
BlockWithScanInfo |
loadDataBlockWithScanInfo(Cell key,
HFileBlock currentBlock,
boolean cacheBlocks,
boolean pread,
boolean isCompaction,
DataBlockEncoding expectedDataBlockEncoding,
HFile.CachingBlockReader cachingBlockReader)
Return the BlockWithScanInfo, a data structure which contains the Data HFileBlock with other
scan info such as the key that starts the next HFileBlock.
|
Cell |
midkey(HFile.CachingBlockReader cachingBlockReader)
An approximation to the
HFile's mid-key. |
int |
rootBlockContainingKey(byte[] key,
int offset,
int length,
CellComparator comp)
Finds the root-level index block containing the given key.
|
int |
rootBlockContainingKey(Cell key)
Finds the root-level index block containing the given key.
|
String |
toString() |
binarySearchNonRootIndex, ensureNonEmpty, getNonRootIndexedKey, getRootBlockCount, getRootBlockDataSize, getRootBlockOffset, heapSize, locateNonRootIndexEntry, readMultiLevelIndexRoot, readRootIndex, readRootIndex, rootBlockContainingKey, seekToDataBlockprivate byte[][] blockKeys
public ByteArrayKeyBlockIndexReader(int treeLevel)
protected long calculateHeapSizeForBlockKeys(long heapSize)
calculateHeapSizeForBlockKeys in class HFileBlockIndex.BlockIndexReaderpublic boolean isEmpty()
HFileBlockIndex.BlockIndexReaderisEmpty in class HFileBlockIndex.BlockIndexReaderpublic byte[] getRootBlockKey(int i)
- 1public BlockWithScanInfo loadDataBlockWithScanInfo(Cell key, HFileBlock currentBlock, boolean cacheBlocks, boolean pread, boolean isCompaction, DataBlockEncoding expectedDataBlockEncoding, HFile.CachingBlockReader cachingBlockReader) throws IOException
HFileBlockIndex.BlockIndexReaderloadDataBlockWithScanInfo in class HFileBlockIndex.BlockIndexReaderkey - the key we are looking forcurrentBlock - the current block, to avoid re-reading the same blockexpectedDataBlockEncoding - the data block encoding the caller is expecting the data
block to be in, or null to not perform this check and return
the block irrespective of the encoding.IOExceptionpublic Cell midkey(HFile.CachingBlockReader cachingBlockReader) throws IOException
HFileBlockIndex.BlockIndexReaderHFile's mid-key. Operates on block boundaries, and does not
go inside blocks. In other words, returns the first key of the middle block of the file.midkey in class HFileBlockIndex.BlockIndexReaderIOExceptionprotected void initialize(int numEntries)
initialize in class HFileBlockIndex.BlockIndexReaderprotected void add(byte[] key, long offset, int dataSize)
add in class HFileBlockIndex.BlockIndexReaderpublic int rootBlockContainingKey(byte[] key, int offset, int length, CellComparator comp)
HFileBlockIndex.BlockIndexReaderrootBlockContainingKey in class HFileBlockIndex.BlockIndexReaderkey (between 0 and the number of blocks - 1)
or -1 if this file does not contain the request.public int rootBlockContainingKey(Cell key)
HFileBlockIndex.BlockIndexReaderrootBlockContainingKey in class HFileBlockIndex.BlockIndexReaderCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.