|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.io.hfile.AbstractHFileReader.Scanner
org.apache.hadoop.hbase.io.hfile.HFileReaderV2.ScannerV2
protected static class HFileReaderV2.ScannerV2
Implementation of HFileScanner
interface.
Field Summary |
---|
Fields inherited from class org.apache.hadoop.hbase.io.hfile.AbstractHFileReader.Scanner |
---|
blockBuffer, blockFetches, cacheBlocks, currKeyLen, currMemstoreTS, currMemstoreTSLen, currValueLen, isCompaction, pread |
Constructor Summary | |
---|---|
HFileReaderV2.ScannerV2(HFileReaderV2 r,
boolean cacheBlocks,
boolean pread,
boolean isCompaction)
|
Method Summary | |
---|---|
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()
|
HFileReaderV2 |
getReader()
|
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. |
boolean |
next()
Go to the next key/value in the block section. |
int |
reseekTo(byte[] key)
Reseek to or just before the passed key . |
int |
reseekTo(byte[] key,
int offset,
int length)
|
boolean |
seekBefore(byte[] key)
Consider the key stream of all the keys in the file, k[0] .. |
boolean |
seekBefore(byte[] key,
int offset,
int length)
|
boolean |
seekTo()
Positions this scanner at the start of the file. |
int |
seekTo(byte[] key)
SeekTo or just before the passed key . |
int |
seekTo(byte[] key,
int offset,
int length)
|
Methods inherited from class org.apache.hadoop.hbase.io.hfile.AbstractHFileReader.Scanner |
---|
assertSeeked, isSeeked, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HFileReaderV2.ScannerV2(HFileReaderV2 r, boolean cacheBlocks, boolean pread, boolean isCompaction)
Method Detail |
---|
public HFileReaderV2 getReader()
public KeyValue getKeyValue()
KeyValue
.public ByteBuffer getKey()
HFileScanner
HFileScanner.seekTo(byte[])
before this method.
public ByteBuffer getValue()
HFileScanner
HFileScanner.seekTo(byte[])
before this method.
public boolean next() throws IOException
getKey()
and getValue()
can
be called.
IOException
public boolean seekTo() throws IOException
IOException
public int seekTo(byte[] key) throws IOException
HFileScanner
key
. 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.
key
- Key to find.
IOException
public int seekTo(byte[] key, int offset, int length) throws IOException
IOException
public int reseekTo(byte[] key) throws IOException
HFileScanner
key
. 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.
key
- Key to find (should be non-null)
IOException
public int reseekTo(byte[] key, int offset, int length) throws IOException
IOException
public boolean seekBefore(byte[] key) throws IOException
HFileScanner
k[0] .. k[n]
, where there are n keys in the file.
key
- Key to find
IOException
public boolean seekBefore(byte[] key, int offset, int length) throws IOException
IOException
public String getKeyString()
HFileScanner
HFileScanner.seekTo(byte[])
before this method.
public String getValueString()
HFileScanner
HFileScanner.seekTo(byte[])
before this method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |