protected static class HFileReaderV2.ScannerV2 extends HFileReaderV2.AbstractScannerV2
HFileScanner interface.block, nextIndexedKeyblockBuffer, 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(byte[] key,
int offset,
int length,
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.
|
int |
compareKey(KeyValue.KVComparator comparator,
byte[] key,
int offset,
int length)
Compare the given key against the current key
|
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.
|
KeyValue |
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,
byte[] nextIndexedKey,
boolean rewind,
byte[] key,
int offset,
int length,
boolean seekBefore) |
boolean |
next()
Go to the next key/value in the block section.
|
protected void |
readKeyValueLen() |
protected void |
readMvccVersion() |
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. |
readNextDataBlock, reseekTo, seekBefore, seekTo, seekToassertSeeked, getReader, isSeeked, reseekTo, seekBefore, seekTo, toStringpublic HFileReaderV2.ScannerV2(HFileReaderV2 r, boolean cacheBlocks, boolean pread, boolean isCompaction)
protected int getCellBufSize()
public ByteBuffer getKey()
HFileScannerHFileScanner.seekTo(byte[]) before this method.public int compareKey(KeyValue.KVComparator comparator, byte[] key, int offset, int length)
HFileReaderV2.AbstractScannerV2compareKey in class HFileReaderV2.AbstractScannerV2public ByteBuffer getValue()
HFileScannerHFileScanner.seekTo(byte[]) before this method.protected void setNonSeekedState()
public boolean next()
throws IOException
getKey() and getValue() can
be called.IOExceptionprotected int getNextCellStartPosition()
public boolean seekTo()
throws IOException
IOExceptionprotected int loadBlockAndSeekToKey(HFileBlock seekToBlock, byte[] nextIndexedKey, boolean rewind, byte[] key, int offset, int length, boolean seekBefore) throws IOException
loadBlockAndSeekToKey in class HFileReaderV2.AbstractScannerV2IOExceptionprotected void updateCurrBlock(HFileBlock newBlock)
HFileBlock. Seeks to
the the first key/value pair.newBlock - the block to make currentprotected void readKeyValueLen()
protected void readMvccVersion()
protected int blockSeek(byte[] key,
int offset,
int length,
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.AbstractScannerV2public String getKeyString()
HFileScannerHFileScanner.seekTo(byte[]) before this method.public String getValueString()
HFileScannerHFileScanner.seekTo(byte[]) before this method.Copyright © 2014 The Apache Software Foundation. All rights reserved.