@InterfaceAudience.Private public class PrefixTreeSeeker extends Object implements DataBlockEncoder.EncodedSeeker
| 限定符和类型 | 字段和说明 |
|---|---|
protected ByteBuffer |
block |
protected boolean |
includeMvccVersion |
protected PrefixTreeArraySearcher |
ptSearcher |
| 构造器和说明 |
|---|
PrefixTreeSeeker(boolean includeMvccVersion) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
advance() |
int |
compareKey(KeyValue.KVComparator comparator,
byte[] key,
int offset,
int length) |
int |
compareKey(KeyValue.KVComparator comparator,
Cell key) |
Cell |
get()
Currently unused.
|
ByteBuffer |
getKeyDeepCopy() |
Cell |
getKeyValue()
currently must do deep copy into new array
|
ByteBuffer |
getValueShallowCopy() |
boolean |
next() |
void |
releaseCurrentSearcher()
Currently unused.
|
void |
rewind() |
int |
seekToKeyInBlock(byte[] keyOnlyBytes,
int offset,
int length,
boolean forceBeforeOnExactMatch)
Seek forward only (should be called reseekToKeyInBlock?).
|
int |
seekToKeyInBlock(Cell key,
boolean forceBeforeOnExactMatch) |
protected int |
seekToOrBeforeUsingPositionAtOrAfter(byte[] keyOnlyBytes,
int offset,
int length,
boolean seekBefore) |
protected int |
seekToOrBeforeUsingPositionAtOrAfter(Cell kv,
boolean seekBefore) |
protected int |
seekToOrBeforeUsingPositionAtOrBefore(byte[] keyOnlyBytes,
int offset,
int length,
boolean seekBefore) |
protected int |
seekToOrBeforeUsingPositionAtOrBefore(Cell kv,
boolean seekBefore) |
void |
setCurrentBuffer(ByteBuffer fullBlockBuffer) |
protected ByteBuffer block
protected boolean includeMvccVersion
protected PrefixTreeArraySearcher ptSearcher
public void setCurrentBuffer(ByteBuffer fullBlockBuffer)
public void releaseCurrentSearcher()
Currently unused.
TODO performance leak. should reuse the searchers. hbase does not currently have a hook where this can be calledpublic ByteBuffer getKeyDeepCopy()
getKeyDeepCopy 在接口中 DataBlockEncoder.EncodedSeekerpublic ByteBuffer getValueShallowCopy()
public Cell getKeyValue()
getKeyValue 在接口中 DataBlockEncoder.EncodedSeekerpublic Cell get()
Currently unused.
A nice, lightweight reference, though the underlying cell is transient. This method may return the same reference to the backing PrefixTreeCell repeatedly, while other implementations may return a different reference for each Cell.
The goal will be to transition the upper layers of HBase, like Filters and KeyValueHeap, to use this method instead of the getKeyValue() methods above.public void rewind()
rewind 在接口中 DataBlockEncoder.EncodedSeekerpublic boolean next()
next 在接口中 DataBlockEncoder.EncodedSeekerpublic boolean advance()
public int seekToKeyInBlock(byte[] keyOnlyBytes,
int offset,
int length,
boolean forceBeforeOnExactMatch)
If the exact key is found look at the seekBefore variable and:
- if true: go to the previous key if it's true
- if false: stay on the exact key
If the exact key is not found, then go to the previous key *if possible*, but remember to leave the scanner in a valid state if possible.
seekToKeyInBlock 在接口中 DataBlockEncoder.EncodedSeekerkeyOnlyBytes - 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 seekToOrBeforeUsingPositionAtOrBefore(Cell kv, boolean seekBefore)
protected int seekToOrBeforeUsingPositionAtOrAfter(byte[] keyOnlyBytes,
int offset,
int length,
boolean seekBefore)
protected int seekToOrBeforeUsingPositionAtOrAfter(Cell kv, boolean seekBefore)
public int compareKey(KeyValue.KVComparator comparator, byte[] key, int offset, int length)
compareKey 在接口中 DataBlockEncoder.EncodedSeekerpublic int seekToKeyInBlock(Cell key, boolean forceBeforeOnExactMatch)
public int compareKey(KeyValue.KVComparator comparator, Cell key)
compareKey 在接口中 DataBlockEncoder.EncodedSeekerCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.