static class HFileBlockIndex.CellBasedKeyBlockIndexReaderV2 extends HFileBlockIndex.CellBasedKeyBlockIndexReader
Modifier and Type | Field and Description |
---|---|
private HFileIndexBlockEncoder |
indexBlockEncoder |
private HFileIndexBlockEncoder.EncodedSeeker |
seeker |
comparator
blockDataSizes, blockOffsets, midKeyEntry, midLeafBlockOffset, midLeafBlockOnDiskSize, rootCount, searchTreeLevel
Constructor and Description |
---|
CellBasedKeyBlockIndexReaderV2(CellComparator c,
int treeLevel) |
CellBasedKeyBlockIndexReaderV2(CellComparator c,
int treeLevel,
HFileIndexBlockEncoder indexBlockEncoder) |
Modifier and Type | Method and Description |
---|---|
protected long |
calculateHeapSizeForBlockKeys(long heapSize) |
int |
getRootBlockCount()
Returns the number of root-level blocks in this block index
|
Cell |
getRootBlockKey(int i)
from 0 to
- 1 |
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. |
void |
readMultiLevelIndexRoot(HFileBlock blk,
int numEntries)
Read the root-level metadata of a multi-level block index.
|
int |
rootBlockContainingKey(Cell key)
Finds the root-level index block containing the given key.
|
String |
toString() |
add, initialize, rootBlockContainingKey
binarySearchNonRootIndex, ensureNonEmpty, getNonRootIndexedKey, getRootBlockDataSize, getRootBlockOffset, heapSize, locateNonRootIndexEntry, readRootIndex, readRootIndex, rootBlockContainingKey, seekToDataBlock
private HFileIndexBlockEncoder indexBlockEncoder
private HFileIndexBlockEncoder.EncodedSeeker seeker
public CellBasedKeyBlockIndexReaderV2(CellComparator c, int treeLevel)
public CellBasedKeyBlockIndexReaderV2(CellComparator c, int treeLevel, HFileIndexBlockEncoder indexBlockEncoder)
public boolean isEmpty()
HFileBlockIndex.BlockIndexReader
isEmpty
in class HFileBlockIndex.CellBasedKeyBlockIndexReader
public BlockWithScanInfo loadDataBlockWithScanInfo(Cell key, HFileBlock currentBlock, boolean cacheBlocks, boolean pread, boolean isCompaction, DataBlockEncoding expectedDataBlockEncoding, HFile.CachingBlockReader cachingBlockReader) throws IOException
HFileBlockIndex.BlockIndexReader
loadDataBlockWithScanInfo
in class HFileBlockIndex.CellBasedKeyBlockIndexReader
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.IOException
public Cell midkey(HFile.CachingBlockReader cachingBlockReader) throws IOException
HFileBlockIndex.BlockIndexReader
HFile
'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.CellBasedKeyBlockIndexReader
IOException
public Cell getRootBlockKey(int i)
- 1
getRootBlockKey
in class HFileBlockIndex.CellBasedKeyBlockIndexReader
public int getRootBlockCount()
HFileBlockIndex.BlockIndexReader
getRootBlockCount
in class HFileBlockIndex.BlockIndexReader
public int rootBlockContainingKey(Cell key)
HFileBlockIndex.BlockIndexReader
rootBlockContainingKey
in class HFileBlockIndex.CellBasedKeyBlockIndexReader
protected long calculateHeapSizeForBlockKeys(long heapSize)
calculateHeapSizeForBlockKeys
in class HFileBlockIndex.CellBasedKeyBlockIndexReader
public void readMultiLevelIndexRoot(HFileBlock blk, int numEntries) throws IOException
HFileBlockIndex.BlockIndexReader
HFileBlockIndex.BlockIndexReader.readRootIndex(DataInput, int)
, but also reads metadata necessary to compute the
mid-key in a multi-level index.readMultiLevelIndexRoot
in class HFileBlockIndex.BlockIndexReader
blk
- the HFile blocknumEntries
- the number of root-level index entriesIOException
public String toString()
toString
in class HFileBlockIndex.CellBasedKeyBlockIndexReader
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.