protected abstract static class BufferedDataBlockEncoder.BufferedEncodedSeeker<STATE extends BufferedDataBlockEncoder.SeekerState> extends Object implements DataBlockEncoder.EncodedSeeker
| Modifier and Type | Field and Description |
|---|---|
protected KeyValue.KVComparator |
comparator |
protected STATE |
current |
protected ByteBuffer |
currentBuffer |
protected HFileBlockDecodingContext |
decodingCtx |
protected STATE |
previous |
protected KeyValue.SamePrefixComparator<byte[]> |
samePrefixComparator |
protected TagCompressionContext |
tagCompressionContext |
| Constructor and Description |
|---|
BufferedDataBlockEncoder.BufferedEncodedSeeker(KeyValue.KVComparator comparator,
HFileBlockDecodingContext decodingCtx) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareKey(KeyValue.KVComparator comparator,
byte[] key,
int offset,
int length)
Compare the given key against the current key
|
int |
compareKey(KeyValue.KVComparator comparator,
Cell key) |
private int |
compareTypeBytes(Cell key,
Cell right) |
protected STATE |
createSeekerState() |
protected abstract void |
decodeFirst() |
protected abstract void |
decodeNext() |
protected void |
decodeTags() |
ByteBuffer |
getKeyDeepCopy()
Does a deep copy of the key at the current position.
|
Cell |
getKeyValue() |
ByteBuffer |
getValueShallowCopy()
Does a shallow copy of the value at the current position.
|
protected boolean |
includesMvcc() |
protected boolean |
includesTags() |
private void |
moveToPrevious() |
boolean |
next()
Move to next position
|
void |
rewind()
Set position to beginning of given block
|
int |
seekToKeyInBlock(byte[] key,
int offset,
int length,
boolean seekBefore)
Moves the seeker position within the current block to:
the last key that that is less than or equal to the given key if
seekBefore is false
the last key that is strictly less than the given key if
seekBefore is true. |
int |
seekToKeyInBlock(Cell seekCell,
boolean seekBefore)
Moves the seeker position within the current block to:
the last key that that is less than or equal to the given key if
seekBefore is false
the last key that is strictly less than the given key if
seekBefore is true. |
void |
setCurrentBuffer(ByteBuffer buffer)
Set on which buffer there will be done seeking.
|
protected HFileBlockDecodingContext decodingCtx
protected final KeyValue.KVComparator comparator
protected final KeyValue.SamePrefixComparator<byte[]> samePrefixComparator
protected ByteBuffer currentBuffer
protected STATE extends BufferedDataBlockEncoder.SeekerState current
protected STATE extends BufferedDataBlockEncoder.SeekerState previous
protected TagCompressionContext tagCompressionContext
public BufferedDataBlockEncoder.BufferedEncodedSeeker(KeyValue.KVComparator comparator, HFileBlockDecodingContext decodingCtx)
protected boolean includesMvcc()
protected boolean includesTags()
public int compareKey(KeyValue.KVComparator comparator, byte[] key, int offset, int length)
DataBlockEncoder.EncodedSeekercompareKey in interface DataBlockEncoder.EncodedSeekerpublic int compareKey(KeyValue.KVComparator comparator, Cell key)
compareKey in interface DataBlockEncoder.EncodedSeekerpublic void setCurrentBuffer(ByteBuffer buffer)
DataBlockEncoder.EncodedSeekersetCurrentBuffer in interface DataBlockEncoder.EncodedSeekerbuffer - Used for seeking.public ByteBuffer getKeyDeepCopy()
DataBlockEncoder.EncodedSeekergetKeyDeepCopy in interface DataBlockEncoder.EncodedSeekerpublic ByteBuffer getValueShallowCopy()
DataBlockEncoder.EncodedSeekergetValueShallowCopy in interface DataBlockEncoder.EncodedSeekerpublic Cell getKeyValue()
getKeyValue in interface DataBlockEncoder.EncodedSeekerpublic void rewind()
DataBlockEncoder.EncodedSeekerrewind in interface DataBlockEncoder.EncodedSeekerpublic boolean next()
DataBlockEncoder.EncodedSeekernext in interface DataBlockEncoder.EncodedSeekerprotected void decodeTags()
public int seekToKeyInBlock(byte[] key,
int offset,
int length,
boolean seekBefore)
DataBlockEncoder.EncodedSeekerseekBefore is false
seekBefore is true. The caller is responsible for loading the
previous block if the requested key turns out to be the first key of the
current block.seekToKeyInBlock in interface DataBlockEncoder.EncodedSeekerkey - byte array containing the keyoffset - key position the arraylength - key length in bytesseekBefore - find the key strictly less than the given key in case
of an exact match. Does not matter in case of an inexact match.public int seekToKeyInBlock(Cell seekCell, boolean seekBefore)
DataBlockEncoder.EncodedSeekerseekBefore is false
seekBefore is true. The caller is responsible for loading the
previous block if the requested key turns out to be the first key of the
current block.seekToKeyInBlock in interface DataBlockEncoder.EncodedSeekerseekCell - - Cell to which the seek should happenseekBefore - find the key strictly less than the given key in case
of an exact match. Does not matter in case of an inexact match.private void moveToPrevious()
protected STATE createSeekerState()
protected abstract void decodeFirst()
protected abstract void decodeNext()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.