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.EncodedSeeker
compareKey
in interface DataBlockEncoder.EncodedSeeker
public int compareKey(KeyValue.KVComparator comparator, Cell key)
compareKey
in interface DataBlockEncoder.EncodedSeeker
public void setCurrentBuffer(ByteBuffer buffer)
DataBlockEncoder.EncodedSeeker
setCurrentBuffer
in interface DataBlockEncoder.EncodedSeeker
buffer
- Used for seeking.public ByteBuffer getKeyDeepCopy()
DataBlockEncoder.EncodedSeeker
getKeyDeepCopy
in interface DataBlockEncoder.EncodedSeeker
public ByteBuffer getValueShallowCopy()
DataBlockEncoder.EncodedSeeker
getValueShallowCopy
in interface DataBlockEncoder.EncodedSeeker
public Cell getKeyValue()
getKeyValue
in interface DataBlockEncoder.EncodedSeeker
public void rewind()
DataBlockEncoder.EncodedSeeker
rewind
in interface DataBlockEncoder.EncodedSeeker
public boolean next()
DataBlockEncoder.EncodedSeeker
next
in interface DataBlockEncoder.EncodedSeeker
protected void decodeTags()
public int seekToKeyInBlock(byte[] key, int offset, int length, boolean seekBefore)
DataBlockEncoder.EncodedSeeker
seekBefore
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.EncodedSeeker
key
- 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.EncodedSeeker
seekBefore
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.EncodedSeeker
seekCell
- - 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.