protected abstract static class HFileReaderV2.AbstractScannerV2 extends AbstractHFileReader.Scanner
Modifier and Type | Field and Description |
---|---|
protected HFileBlock |
block |
protected Cell |
nextIndexedKey
The next indexed key is to keep track of the indexed key of the next data block.
|
blockBuffer, blockFetches, cacheBlocks, currKeyLen, currMemstoreTS, currMemstoreTSLen, currValueLen, isCompaction, pread, reader
Constructor and Description |
---|
HFileReaderV2.AbstractScannerV2(HFileReaderV2 r,
boolean cacheBlocks,
boolean pread,
boolean isCompaction) |
Modifier and Type | Method and Description |
---|---|
abstract int |
compareKey(KeyValue.KVComparator comparator,
byte[] key,
int offset,
int length)
Compare the given key against the current key
|
abstract int |
compareKey(KeyValue.KVComparator comparator,
Cell kv) |
DataBlockEncoding |
getEffectiveDataBlockEncoding() |
protected abstract ByteBuffer |
getFirstKeyInBlock(HFileBlock curBlock) |
Cell |
getNextIndexedKey() |
protected abstract int |
loadBlockAndSeekToKey(HFileBlock seekToBlock,
Cell nextIndexedKey,
boolean rewind,
Cell key,
boolean seekBefore) |
protected HFileBlock |
readNextDataBlock()
Scans blocks in the "scanned" section of the
HFile until the next
data block is found. |
int |
reseekTo(byte[] key,
int offset,
int length) |
int |
reseekTo(Cell key) |
boolean |
seekBefore(byte[] key,
int offset,
int length) |
boolean |
seekBefore(Cell key) |
int |
seekTo(byte[] key,
int offset,
int length) |
int |
seekTo(Cell key) |
int |
seekTo(Cell key,
boolean rewind)
An internal API function.
|
assertSeeked, close, getReader, isSeeked, reseekTo, seekBefore, seekTo, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getKey, getKeyString, getKeyValue, getValue, getValueString, next, seekTo
protected HFileBlock block
protected Cell nextIndexedKey
public HFileReaderV2.AbstractScannerV2(HFileReaderV2 r, boolean cacheBlocks, boolean pread, boolean isCompaction)
public Cell getNextIndexedKey()
protected abstract ByteBuffer getFirstKeyInBlock(HFileBlock curBlock)
protected abstract int loadBlockAndSeekToKey(HFileBlock seekToBlock, Cell nextIndexedKey, boolean rewind, Cell key, boolean seekBefore) throws IOException
IOException
public int seekTo(byte[] key, int offset, int length) throws IOException
IOException
public int reseekTo(byte[] key, int offset, int length) throws IOException
IOException
public int seekTo(Cell key) throws IOException
IOException
public int reseekTo(Cell key) throws IOException
IOException
public int seekTo(Cell key, boolean rewind) throws IOException
key
- - a cell representing the key that we need to fetchrewind
- whether to rewind to the first key of the block before
doing the seek. If this is false, we are assuming we never go
back, otherwise the result is undefined.IOException
public boolean seekBefore(byte[] key, int offset, int length) throws IOException
IOException
public boolean seekBefore(Cell key) throws IOException
IOException
protected HFileBlock readNextDataBlock() throws IOException
HFile
until the next
data block is found.IOException
public DataBlockEncoding getEffectiveDataBlockEncoding()
public abstract int compareKey(KeyValue.KVComparator comparator, byte[] key, int offset, int length)
comparator
- key
- offset
- length
- public abstract int compareKey(KeyValue.KVComparator comparator, Cell kv)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.