Package org.apache.hadoop.hbase.io.hfile
Class HFileBlockIndex.CellBasedKeyBlockIndexReaderV2
java.lang.Object
org.apache.hadoop.hbase.io.hfile.HFileBlockIndex.BlockIndexReader
org.apache.hadoop.hbase.io.hfile.HFileBlockIndex.CellBasedKeyBlockIndexReader
org.apache.hadoop.hbase.io.hfile.HFileBlockIndex.CellBasedKeyBlockIndexReaderV2
- All Implemented Interfaces:
HeapSize
- Enclosing class:
- HFileBlockIndex
-
Field Summary
FieldsFields inherited from class org.apache.hadoop.hbase.io.hfile.HFileBlockIndex.CellBasedKeyBlockIndexReader
comparatorFields inherited from class org.apache.hadoop.hbase.io.hfile.HFileBlockIndex.BlockIndexReader
blockDataSizes, blockOffsets, midKeyEntry, midLeafBlockOffset, midLeafBlockOnDiskSize, rootCount, searchTreeLevel -
Constructor Summary
ConstructorsConstructorDescriptionCellBasedKeyBlockIndexReaderV2(CellComparator c, int treeLevel) CellBasedKeyBlockIndexReaderV2(CellComparator c, int treeLevel, HFileIndexBlockEncoder indexBlockEncoder) -
Method Summary
Modifier and TypeMethodDescriptionprotected longcalculateHeapSizeForBlockKeys(long heapSize) intReturns the number of root-level blocks in this block indexgetRootBlockKey(int i) from 0 to- 1booleanisEmpty()Returns true if the block index is empty.loadDataBlockWithScanInfo(ExtendedCell 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.midkey(HFile.CachingBlockReader cachingBlockReader) An approximation to theHFile's mid-key.voidreadMultiLevelIndexRoot(HFileBlock blk, int numEntries) Read the root-level metadata of a multi-level block index.intFinds the root-level index block containing the given key.toString()Methods inherited from class org.apache.hadoop.hbase.io.hfile.HFileBlockIndex.CellBasedKeyBlockIndexReader
add, initialize, rootBlockContainingKeyMethods inherited from class org.apache.hadoop.hbase.io.hfile.HFileBlockIndex.BlockIndexReader
binarySearchNonRootIndex, ensureNonEmpty, getNonRootIndexedKey, getRootBlockDataSize, getRootBlockOffset, heapSize, locateNonRootIndexEntry, readRootIndex, readRootIndex, rootBlockContainingKey, seekToDataBlock
-
Field Details
-
indexBlockEncoder
-
seeker
-
-
Constructor Details
-
CellBasedKeyBlockIndexReaderV2
-
CellBasedKeyBlockIndexReaderV2
public CellBasedKeyBlockIndexReaderV2(CellComparator c, int treeLevel, HFileIndexBlockEncoder indexBlockEncoder)
-
-
Method Details
-
isEmpty
Description copied from class:HFileBlockIndex.BlockIndexReaderReturns true if the block index is empty.- Overrides:
isEmptyin classHFileBlockIndex.CellBasedKeyBlockIndexReader
-
loadDataBlockWithScanInfo
public BlockWithScanInfo loadDataBlockWithScanInfo(ExtendedCell key, HFileBlock currentBlock, boolean cacheBlocks, boolean pread, boolean isCompaction, DataBlockEncoding expectedDataBlockEncoding, HFile.CachingBlockReader cachingBlockReader) throws IOException Description copied from class:HFileBlockIndex.BlockIndexReaderReturn the BlockWithScanInfo, a data structure which contains the Data HFileBlock with other scan info such as the key that starts the next HFileBlock. This function will only be called when the HFile version is larger than 1.- Overrides:
loadDataBlockWithScanInfoin classHFileBlockIndex.CellBasedKeyBlockIndexReader- Parameters:
key- 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.- Returns:
- the BlockWithScanInfo which contains the DataBlock with other scan info such as nextIndexedKey.
- Throws:
IOException
-
midkey
Description copied from class:HFileBlockIndex.BlockIndexReaderAn approximation to theHFile'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.- Overrides:
midkeyin classHFileBlockIndex.CellBasedKeyBlockIndexReader- Returns:
- the first key of the middle block
- Throws:
IOException
-
getRootBlockKey
from 0 to- 1- Overrides:
getRootBlockKeyin classHFileBlockIndex.CellBasedKeyBlockIndexReader
-
getRootBlockCount
Description copied from class:HFileBlockIndex.BlockIndexReaderReturns the number of root-level blocks in this block index- Overrides:
getRootBlockCountin classHFileBlockIndex.BlockIndexReader
-
rootBlockContainingKey
Description copied from class:HFileBlockIndex.BlockIndexReaderFinds the root-level index block containing the given key. Key to find- Overrides:
rootBlockContainingKeyin classHFileBlockIndex.CellBasedKeyBlockIndexReader
-
calculateHeapSizeForBlockKeys
- Overrides:
calculateHeapSizeForBlockKeysin classHFileBlockIndex.CellBasedKeyBlockIndexReader
-
readMultiLevelIndexRoot
Description copied from class:HFileBlockIndex.BlockIndexReaderRead the root-level metadata of a multi-level block index. Based onHFileBlockIndex.BlockIndexReader.readRootIndex(DataInput, int), but also reads metadata necessary to compute the mid-key in a multi-level index.- Overrides:
readMultiLevelIndexRootin classHFileBlockIndex.BlockIndexReader- Parameters:
blk- the HFile blocknumEntries- the number of root-level index entries- Throws:
IOException
-
toString
- Overrides:
toStringin classHFileBlockIndex.CellBasedKeyBlockIndexReader
-