protected static class HFileReaderV2.ScannerV2 extends HFileReaderV2.AbstractScannerV2
HFileScanner
interface.block, nextIndexedKey
blockBuffer, blockFetches, cacheBlocks, currKeyLen, currMemstoreTS, currMemstoreTSLen, currValueLen, isCompaction, pread
Constructor and Description |
---|
HFileReaderV2.ScannerV2(HFileReaderV2 r,
boolean cacheBlocks,
boolean pread,
boolean isCompaction) |
Modifier and Type | Method and Description |
---|---|
protected int |
blockSeek(Cell key,
boolean seekBefore)
Within a loaded block, seek looking for the last key that is smaller than
(or equal to?) the key we are interested in.
|
protected void |
checkKeyValueLen()
Check key and value lengths are wholesome.
|
protected boolean |
checkLen(int v) |
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) |
protected Cell |
formNoTagsKeyValue() |
protected int |
getCellBufSize() |
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() |
protected int |
getNextCellStartPosition() |
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.
|
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 void |
readKeyValueLen() |
protected void |
readMvccVersion() |
protected void |
readMvccVersion(int position)
Read mvcc.
|
boolean |
seekTo()
Positions this scanner at the start of the file.
|
protected void |
setNonSeekedState() |
protected void |
updateCurrBlock(HFileBlock newBlock)
Updates the current block to be the given
HFileBlock . |
getEffectiveDataBlockEncoding, getNextIndexedKey, readNextDataBlock, reseekTo, reseekTo, seekBefore, seekBefore, seekTo, seekTo, seekTo
assertSeeked, getReader, isSeeked, reseekTo, seekBefore, seekTo, toString
public HFileReaderV2.ScannerV2(HFileReaderV2 r, boolean cacheBlocks, boolean pread, boolean isCompaction)
protected Cell formNoTagsKeyValue()
protected int getCellBufSize()
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.protected void setNonSeekedState()
public boolean next() throws IOException
getKey()
and getValue()
can
be called.IOException
protected int getNextCellStartPosition()
public boolean seekTo() throws IOException
IOException
protected int loadBlockAndSeekToKey(HFileBlock seekToBlock, Cell nextIndexedKey, boolean rewind, Cell key, boolean seekBefore) throws IOException
loadBlockAndSeekToKey
in class HFileReaderV2.AbstractScannerV2
IOException
protected void updateCurrBlock(HFileBlock newBlock)
HFileBlock
. Seeks to
the the first key/value pair.newBlock
- the block to make currentprotected final boolean checkLen(int v)
v
- protected final void checkKeyValueLen()
protected void readKeyValueLen()
protected void readMvccVersion(int position)
position
- protected void readMvccVersion()
protected int blockSeek(Cell key, boolean seekBefore)
key
- the key to findseekBefore
- find the key before the given key in case of exact match.protected ByteBuffer getFirstKeyInBlock(HFileBlock curBlock)
getFirstKeyInBlock
in class HFileReaderV2.AbstractScannerV2
public String getKeyString()
HFileScanner
HFileScanner.seekTo(byte[])
before this method.public String getValueString()
HFileScanner
HFileScanner.seekTo(byte[])
before this method.public int compareKey(KeyValue.KVComparator comparator, Cell key)
compareKey
in class HFileReaderV2.AbstractScannerV2
Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.