protected static class HFileReaderImpl.EncodedScanner extends HFileReaderImpl.HFileScannerImpl
| Modifier and Type | Field and Description |
|---|---|
private DataBlockEncoder |
dataBlockEncoder |
private HFileBlockDecodingContext |
decodingCtx |
private DataBlockEncoder.EncodedSeeker |
seeker |
cacheBlocks, curBlock, isCompaction, nextIndexedKey, pair, pread, prevBlocks, reader| Constructor and Description |
|---|
EncodedScanner(HFile.Reader reader,
boolean cacheBlocks,
boolean pread,
boolean isCompaction,
HFileContext meta) |
| Modifier and Type | Method and Description |
|---|---|
private void |
assertValidSeek() |
int |
compareKey(CellComparator comparator,
Cell key) |
Cell |
getCell() |
private ByteBuff |
getEncodedBuffer(HFileBlock newBlock) |
protected Cell |
getFirstKeyCellInBlock(HFileBlock curBlock) |
Cell |
getKey()
Gets the current key in the form of a cell.
|
String |
getKeyString()
Convenience method to get a copy of the key as a string - interpreting the
bytes as UTF8.
|
ByteBuffer |
getValue()
Gets a buffer view to the current value.
|
String |
getValueString()
Convenience method to get a copy of the value as a string - interpreting
the bytes as UTF8.
|
boolean |
isSeeked() |
protected int |
loadBlockAndSeekToKey(HFileBlock seekToBlock,
Cell nextIndexedKey,
boolean rewind,
Cell key,
boolean seekBefore) |
boolean |
next()
Go to the next key/value in the block section.
|
protected boolean |
processFirstDataBlock() |
void |
setNonSeekedState() |
protected void |
updateCurrentBlock(HFileBlock newBlock)
Updates the current block to be the given
HFileBlock. |
assertSeeked, blockSeek, checkKeyLen, checkKeyValueLen, checkLen, close, getEffectiveDataBlockEncoding, getNextIndexedKey, getReader, readAndUpdateNewBlock, readKeyValueLen, readMvccVersion, readNextDataBlock, releaseIfNotCurBlock, reseekTo, reset, seekBefore, seekTo, seekTo, seekTo, shipped, toString, updateCurrBlockRefprivate final HFileBlockDecodingContext decodingCtx
private final DataBlockEncoder.EncodedSeeker seeker
private final DataBlockEncoder dataBlockEncoder
public EncodedScanner(HFile.Reader reader, boolean cacheBlocks, boolean pread, boolean isCompaction, HFileContext meta)
public boolean isSeeked()
isSeeked in interface HFileScannerisSeeked in class HFileReaderImpl.HFileScannerImplHFileScanner.seekBefore(Cell) or HFileScanner.seekTo() or HFileScanner.seekTo(Cell).
Otherwise returns false.public void setNonSeekedState()
setNonSeekedState in class HFileReaderImpl.HFileScannerImplprotected void updateCurrentBlock(HFileBlock newBlock) throws CorruptHFileException
HFileBlock. Seeks to the the first
key/value pair.updateCurrentBlock in class HFileReaderImpl.HFileScannerImplnewBlock - the block to make current, and read by HFileReaderImpl.readBlock(long, long, boolean, boolean, boolean, boolean, org.apache.hadoop.hbase.io.hfile.BlockType, org.apache.hadoop.hbase.io.encoding.DataBlockEncoding),
it's a totally new block with new allocated ByteBuff, so if no further
reference to this block, we should release it carefully.CorruptHFileExceptionprivate ByteBuff getEncodedBuffer(HFileBlock newBlock)
protected boolean processFirstDataBlock() throws IOException
processFirstDataBlock in class HFileReaderImpl.HFileScannerImplIOExceptionpublic boolean next() throws IOException
HFileReaderImpl.HFileScannerImplHFileReaderImpl.HFileScannerImpl.getKey() and HFileReaderImpl.HFileScannerImpl.getValue() can
be called.next in interface HFileScannernext in class HFileReaderImpl.HFileScannerImplIOExceptionpublic Cell getKey()
HFileScannerHFileScanner.seekTo(Cell) before this method.getKey in interface HFileScannergetKey in class HFileReaderImpl.HFileScannerImplpublic ByteBuffer getValue()
HFileScannerHFileScanner.seekTo(Cell) before this method.getValue in interface HFileScannergetValue in class HFileReaderImpl.HFileScannerImplpublic Cell getCell()
getCell in interface HFileScannergetCell in class HFileReaderImpl.HFileScannerImplCell.public String getKeyString()
HFileScannerHFileScanner.seekTo(Cell) before this method.getKeyString in interface HFileScannergetKeyString in class HFileReaderImpl.HFileScannerImplpublic String getValueString()
HFileScannerHFileScanner.seekTo(Cell) before this method.getValueString in interface HFileScannergetValueString in class HFileReaderImpl.HFileScannerImplprivate void assertValidSeek()
protected Cell getFirstKeyCellInBlock(HFileBlock curBlock)
getFirstKeyCellInBlock in class HFileReaderImpl.HFileScannerImplprotected int loadBlockAndSeekToKey(HFileBlock seekToBlock, Cell nextIndexedKey, boolean rewind, Cell key, boolean seekBefore) throws IOException
loadBlockAndSeekToKey in class HFileReaderImpl.HFileScannerImplIOExceptionpublic int compareKey(CellComparator comparator, Cell key)
compareKey in class HFileReaderImpl.HFileScannerImplCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.