protected abstract static class AbstractHFileReader.Scanner extends Object implements HFileScanner
| Modifier and Type | Field and Description |
|---|---|
protected ByteBuffer |
blockBuffer |
protected int |
blockFetches |
protected boolean |
cacheBlocks |
protected int |
currKeyLen |
protected long |
currMemstoreTS |
protected int |
currMemstoreTSLen |
protected int |
currValueLen |
protected boolean |
isCompaction |
protected boolean |
pread |
protected HFile.Reader |
reader |
| Constructor and Description |
|---|
AbstractHFileReader.Scanner(HFile.Reader reader,
boolean cacheBlocks,
boolean pread,
boolean isCompaction) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertSeeked() |
HFile.Reader |
getReader() |
boolean |
isSeeked() |
int |
reseekTo(byte[] key)
Reseek to or just before the passed
key. |
boolean |
seekBefore(byte[] key)
Consider the key stream of all the keys in the file,
k[0] .. |
int |
seekTo(byte[] key)
SeekTo or just before the passed
key. |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetKey, getKeyString, getKeyValue, getValue, getValueString, next, reseekTo, seekBefore, seekTo, seekToprotected ByteBuffer blockBuffer
protected boolean cacheBlocks
protected final boolean pread
protected final boolean isCompaction
protected int currKeyLen
protected int currValueLen
protected int currMemstoreTSLen
protected long currMemstoreTS
protected int blockFetches
protected final HFile.Reader reader
public AbstractHFileReader.Scanner(HFile.Reader reader, boolean cacheBlocks, boolean pread, boolean isCompaction)
public boolean isSeeked()
isSeeked in interface HFileScannerHFileScanner.seekBefore(byte[]) or HFileScanner.seekTo() or HFileScanner.seekTo(byte[]).
Otherwise returns false.protected void assertSeeked()
public int seekTo(byte[] key)
throws IOException
HFileScannerkey. Examine the return
code to figure whether we found the key or not.
Consider the key stream of all the keys in the file,
k[0] .. k[n], where there are n keys in the file.seekTo in interface HFileScannerkey - Key to find.IOExceptionpublic boolean seekBefore(byte[] key)
throws IOException
HFileScannerk[0] .. k[n], where there are n keys in the file.seekBefore in interface HFileScannerkey - Key to findIOExceptionpublic int reseekTo(byte[] key)
throws IOException
HFileScannerkey. Similar to seekTo
except that this can be called even if the scanner is not at the beginning
of a file.
This can be used to seek only to keys which come after the current position
of the scanner.
Consider the key stream of all the keys in the file,
k[0] .. k[n], where there are n keys in the file after
current position of HFileScanner.
The scanner will position itself between k[i] and k[i+1] where
k[i] < key <= k[i+1].
If there is no key k[i+1] greater than or equal to the input key, then the
scanner will position itself at the end of the file and next() will return
false when it is called.reseekTo in interface HFileScannerkey - Key to find (should be non-null)IOExceptionpublic HFile.Reader getReader()
getReader in interface HFileScannerCopyright © 2014 The Apache Software Foundation. All rights reserved.