protected abstract static class HFileReaderV2.AbstractScannerV2 extends AbstractHFileReader.Scanner
Modifier and Type | Field and Description |
---|---|
protected HFileBlock |
block |
protected byte[] |
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
|
protected abstract ByteBuffer |
getFirstKeyInBlock(HFileBlock curBlock) |
protected abstract int |
loadBlockAndSeekToKey(HFileBlock seekToBlock,
byte[] nextIndexedKey,
boolean rewind,
byte[] key,
int offset,
int length,
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) |
boolean |
seekBefore(byte[] key,
int offset,
int length) |
int |
seekTo(byte[] key,
int offset,
int length) |
protected int |
seekTo(byte[] key,
int offset,
int length,
boolean rewind)
An internal API function.
|
assertSeeked, 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 byte[] nextIndexedKey
public HFileReaderV2.AbstractScannerV2(HFileReaderV2 r, boolean cacheBlocks, boolean pread, boolean isCompaction)
protected int seekTo(byte[] key, int offset, int length, boolean rewind) throws IOException
key
- key byte arrayoffset
- key offset in the key byte arraylength
- key lengthrewind
- 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
protected abstract ByteBuffer getFirstKeyInBlock(HFileBlock curBlock)
protected abstract int loadBlockAndSeekToKey(HFileBlock seekToBlock, byte[] nextIndexedKey, boolean rewind, byte[] key, int offset, int length, 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 boolean seekBefore(byte[] key, int offset, int length) throws IOException
IOException
protected HFileBlock readNextDataBlock() throws IOException
HFile
until the next
data block is found.IOException
public abstract int compareKey(KeyValue.KVComparator comparator, byte[] key, int offset, int length)
comparator
- key
- offset
- length
- Copyright © 2014 The Apache Software Foundation. All rights reserved.