protected static class HFileReaderV2.EncodedScannerV2 extends HFileReaderV2.AbstractScannerV2
Modifier and Type | Field and Description |
---|---|
private DataBlockEncoder |
dataBlockEncoder |
private HFileBlockDecodingContext |
decodingCtx |
protected HFileContext |
meta |
private DataBlockEncoder.EncodedSeeker |
seeker |
block, nextIndexedKey
blockBuffer, blockFetches, cacheBlocks, currKeyLen, currMemstoreTS, currMemstoreTSLen, currValueLen, isCompaction, pread, reader
Constructor and Description |
---|
HFileReaderV2.EncodedScannerV2(HFileReaderV2 reader,
boolean cacheBlocks,
boolean pread,
boolean isCompaction,
HFileContext meta) |
Modifier and Type | Method and Description |
---|---|
private void |
assertValidSeek() |
int |
compareKey(KeyValue.KVComparator comparator,
byte[] key,
int offset,
int length)
Compare the given key against the current key
|
int |
compareKey(KeyValue.KVComparator comparator,
Cell key) |
private ByteBuffer |
getEncodedBuffer(HFileBlock newBlock) |
protected ByteBuffer |
getFirstKeyInBlock(HFileBlock curBlock) |
ByteBuffer |
getKey()
Gets a buffer view to the current key.
|
String |
getKeyString()
Convenience method to get a copy of the key as a string - interpreting the
bytes as UTF8.
|
Cell |
getKeyValue() |
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()
Scans to the next entry in the file.
|
boolean |
seekTo()
Positions this scanner at the start of the file.
|
private void |
updateCurrentBlock(HFileBlock newBlock)
Updates the current block to be the given
HFileBlock . |
getEffectiveDataBlockEncoding, getNextIndexedKey, readNextDataBlock, reseekTo, reseekTo, seekBefore, seekBefore, seekTo, seekTo, seekTo
assertSeeked, close, getReader, reseekTo, seekBefore, seekTo, toString
private final HFileBlockDecodingContext decodingCtx
private final DataBlockEncoder.EncodedSeeker seeker
private final DataBlockEncoder dataBlockEncoder
protected final HFileContext meta
public HFileReaderV2.EncodedScannerV2(HFileReaderV2 reader, boolean cacheBlocks, boolean pread, boolean isCompaction, HFileContext meta)
public boolean isSeeked()
isSeeked
in interface HFileScanner
isSeeked
in class AbstractHFileReader.Scanner
HFileScanner.seekBefore(byte[])
or HFileScanner.seekTo()
or HFileScanner.seekTo(byte[])
.
Otherwise returns false.private void updateCurrentBlock(HFileBlock newBlock) throws CorruptHFileException
HFileBlock
. Seeks to
the the first key/value pair.newBlock
- the block to make currentCorruptHFileException
private ByteBuffer getEncodedBuffer(HFileBlock newBlock)
public boolean seekTo() throws IOException
HFileScanner
IOException
public boolean next() throws IOException
HFileScanner
IOException
public ByteBuffer getKey()
HFileScanner
HFileScanner.seekTo(byte[])
before this method.public int compareKey(KeyValue.KVComparator comparator, byte[] key, int offset, int length)
HFileReaderV2.AbstractScannerV2
compareKey
in class HFileReaderV2.AbstractScannerV2
public ByteBuffer getValue()
HFileScanner
HFileScanner.seekTo(byte[])
before this method.public String getKeyString()
HFileScanner
HFileScanner.seekTo(byte[])
before this method.public String getValueString()
HFileScanner
HFileScanner.seekTo(byte[])
before this method.private void assertValidSeek()
protected ByteBuffer getFirstKeyInBlock(HFileBlock curBlock)
getFirstKeyInBlock
in class HFileReaderV2.AbstractScannerV2
protected int loadBlockAndSeekToKey(HFileBlock seekToBlock, Cell nextIndexedKey, boolean rewind, Cell key, boolean seekBefore) throws IOException
loadBlockAndSeekToKey
in class HFileReaderV2.AbstractScannerV2
IOException
public int compareKey(KeyValue.KVComparator comparator, Cell key)
compareKey
in class HFileReaderV2.AbstractScannerV2
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.