|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.codec.prefixtree.PrefixTreeSeeker
@InterfaceAudience.Private public class PrefixTreeSeeker
These methods have the same definition as any implementation of the EncodedSeeker. In the future, the EncodedSeeker could be modified to work with the Cell interface directly. It currently returns a new KeyValue object each time getKeyValue is called. This is not horrible, but in order to create a new KeyValue object, we must first allocate a new byte[] and copy in the data from the PrefixTreeCell. It is somewhat heavyweight right now.
Field Summary | |
---|---|
protected ByteBuffer |
block
|
protected boolean |
includeMvccVersion
|
protected boolean |
movedToPrevious
|
protected PrefixTreeArraySearcher |
ptSearcher
|
Constructor Summary | |
---|---|
PrefixTreeSeeker(boolean includeMvccVersion)
|
Method Summary | |
---|---|
boolean |
advance()
|
int |
compareKey(KeyValue.KVComparator comparator,
byte[] key,
int offset,
int length)
Compare the given key against the current key |
Cell |
get()
Currently unused. |
ByteBuffer |
getKeyDeepCopy()
Does a deep copy of the key at the current position. |
KeyValue |
getKeyValue()
currently must do deep copy into new array |
ByteBuffer |
getValueShallowCopy()
Does a shallow copy of the value at the current position. |
boolean |
next()
Move to next position |
void |
releaseCurrentSearcher()
Currently unused. |
void |
rewind()
Set position to beginning of given block |
int |
seekToKeyInBlock(byte[] keyOnlyBytes,
int offset,
int length,
boolean forceBeforeOnExactMatch)
Seek forward only (should be called reseekToKeyInBlock?). |
protected int |
seekToOrBeforeUsingPositionAtOrAfter(byte[] keyOnlyBytes,
int offset,
int length,
boolean seekBefore)
|
protected int |
seekToOrBeforeUsingPositionAtOrBefore(byte[] keyOnlyBytes,
int offset,
int length,
boolean seekBefore)
|
void |
setCurrentBuffer(ByteBuffer fullBlockBuffer)
Set on which buffer there will be done seeking. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ByteBuffer block
protected boolean includeMvccVersion
protected PrefixTreeArraySearcher ptSearcher
protected boolean movedToPrevious
Constructor Detail |
---|
public PrefixTreeSeeker(boolean includeMvccVersion)
Method Detail |
---|
public void setCurrentBuffer(ByteBuffer fullBlockBuffer)
DataBlockEncoder.EncodedSeeker
setCurrentBuffer
in interface DataBlockEncoder.EncodedSeeker
fullBlockBuffer
- Used for seeking.public void releaseCurrentSearcher()
public ByteBuffer getKeyDeepCopy()
DataBlockEncoder.EncodedSeeker
getKeyDeepCopy
in interface DataBlockEncoder.EncodedSeeker
public ByteBuffer getValueShallowCopy()
DataBlockEncoder.EncodedSeeker
getValueShallowCopy
in interface DataBlockEncoder.EncodedSeeker
public KeyValue getKeyValue()
getKeyValue
in interface DataBlockEncoder.EncodedSeeker
public Cell get()
public void rewind()
DataBlockEncoder.EncodedSeeker
rewind
in interface DataBlockEncoder.EncodedSeeker
public boolean next()
DataBlockEncoder.EncodedSeeker
next
in interface DataBlockEncoder.EncodedSeeker
public boolean advance()
public int seekToKeyInBlock(byte[] keyOnlyBytes, int offset, int length, boolean forceBeforeOnExactMatch)
seekToKeyInBlock
in interface DataBlockEncoder.EncodedSeeker
keyOnlyBytes
- KeyValue format of a Cell's key at which to position the seekeroffset
- offset into the keyOnlyBytes arraylength
- number of bytes of the keyOnlyBytes array to useforceBeforeOnExactMatch
- if an exact match is found and seekBefore=true, back up 1 Cell
protected int seekToOrBeforeUsingPositionAtOrBefore(byte[] keyOnlyBytes, int offset, int length, boolean seekBefore)
protected int seekToOrBeforeUsingPositionAtOrAfter(byte[] keyOnlyBytes, int offset, int length, boolean seekBefore)
public int compareKey(KeyValue.KVComparator comparator, byte[] key, int offset, int length)
DataBlockEncoder.EncodedSeeker
compareKey
in interface DataBlockEncoder.EncodedSeeker
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |