@InterfaceAudience.Private public class PrefixTreeSeeker extends Object implements DataBlockEncoder.EncodedSeeker
Modifier and Type | Field and Description |
---|---|
protected ByteBuffer |
block |
protected boolean |
includeMvccVersion |
protected boolean |
movedToPrevious |
protected PrefixTreeArraySearcher |
ptSearcher |
Constructor and Description |
---|
PrefixTreeSeeker(boolean includeMvccVersion) |
Modifier and Type | Method and Description |
---|---|
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 |
getKeyValueBuffer()
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.
|
protected ByteBuffer block
protected boolean includeMvccVersion
protected PrefixTreeArraySearcher ptSearcher
protected boolean movedToPrevious
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 ByteBuffer getKeyValueBuffer()
getKeyValueBuffer
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 Cellprotected 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
Copyright © 2014 The Apache Software Foundation. All rights reserved.