Class BufferedDataBlockEncoder.BufferedEncodedSeeker<STATE extends BufferedDataBlockEncoder.SeekerState>
java.lang.Object
org.apache.hadoop.hbase.io.encoding.AbstractDataBlockEncoder.AbstractEncodedSeeker
org.apache.hadoop.hbase.io.encoding.BufferedDataBlockEncoder.BufferedEncodedSeeker<STATE>
- All Implemented Interfaces:
DataBlockEncoder.EncodedSeeker
- Direct Known Subclasses:
CopyKeyDataBlockEncoder.SeekerStateBufferedEncodedSeeker,DiffKeyDeltaEncoder.DiffSeekerStateBufferedEncodedSeeker,FastDiffDeltaEncoder.FastDiffSeekerStateBufferedEncodedSeeker,PrefixKeyDeltaEncoder.SeekerStateBufferedEncodedSeeker
- Enclosing class:
- BufferedDataBlockEncoder
protected abstract static class BufferedDataBlockEncoder.BufferedEncodedSeeker<STATE extends BufferedDataBlockEncoder.SeekerState>
extends AbstractDataBlockEncoder.AbstractEncodedSeeker
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected STATEprotected ByteBuffprotected KeyValue.KeyOnlyKeyValueprotected STATEprotected TagCompressionContextprotected final ObjectIntPair<ByteBuffer>Fields inherited from class org.apache.hadoop.hbase.io.encoding.AbstractDataBlockEncoder.AbstractEncodedSeeker
decodingCtx -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareKey(CellComparator comparator, ExtendedCell key) Compare the given key against the current keyprivate intcompareTypeBytes(ExtendedCell key, ExtendedCell right) protected STATEprotected abstract voidprotected abstract voidprotected voidprivate static intfindCommonPrefixInFamilyPart(Cell left, KeyValue.KeyOnlyKeyValue right, int familyCommonPrefix) private static intfindCommonPrefixInQualifierPart(Cell left, KeyValue.KeyOnlyKeyValue right, int qualifierCommonPrefix) private static intfindCommonPrefixInRowPart(Cell left, KeyValue.KeyOnlyKeyValue right, int rowCommonPrefix) getCell()Returns the Cell at the current position.getKey()From the current position creates a cell using the key part of the current bufferDoes a shallow copy of the value at the current position.private voidbooleannext()Move to next positionvoidrewind()Set position to beginning of given blockintseekToKeyInBlock(ExtendedCell 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 ifseekBeforeis false the last key that is strictly less than the given key ifseekBeforeis true.voidsetCurrentBuffer(ByteBuff buffer) Set on which buffer there will be done seeking.Methods inherited from class org.apache.hadoop.hbase.io.encoding.AbstractDataBlockEncoder.AbstractEncodedSeeker
includesMvcc, includesTags
-
Field Details
-
currentBuffer
-
tagCompressionContext
-
keyOnlyKV
-
tmpPair
-
current
-
previous
-
-
Constructor Details
-
BufferedEncodedSeeker
-
-
Method Details
-
compareKey
Description copied from interface:DataBlockEncoder.EncodedSeekerCompare the given key against the current key- Returns:
- -1 is the passed key is smaller than the current key, 0 if equal and 1 if greater
-
setCurrentBuffer
Description copied from interface:DataBlockEncoder.EncodedSeekerSet on which buffer there will be done seeking.- Parameters:
buffer- Used for seeking.
-
getKey
Description copied from interface:DataBlockEncoder.EncodedSeekerFrom the current position creates a cell using the key part of the current buffer- Returns:
- key at current position
-
getValueShallowCopy
Description copied from interface:DataBlockEncoder.EncodedSeekerDoes a shallow copy of the value at the current position. A shallow copy is possible because the returned buffer refers to the backing array of the original encoded buffer.- Returns:
- value at current position
-
getCell
Description copied from interface:DataBlockEncoder.EncodedSeekerReturns the Cell at the current position. Includes memstore timestamp. -
rewind
Description copied from interface:DataBlockEncoder.EncodedSeekerSet position to beginning of given block -
next
Description copied from interface:DataBlockEncoder.EncodedSeekerMove to next position- Returns:
- true on success, false if there is no more positions.
-
decodeTags
-
seekToKeyInBlock
Description copied from interface:DataBlockEncoder.EncodedSeekerMoves the seeker position within the current block to:- the last key that that is less than or equal to the given key if
seekBeforeis false - the last key that is strictly less than the given key if
seekBeforeis 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.
- Parameters:
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.- Returns:
- 0 on exact match, 1 on inexact match.
- the last key that that is less than or equal to the given key if
-
compareTypeBytes
-
findCommonPrefixInRowPart
private static int findCommonPrefixInRowPart(Cell left, KeyValue.KeyOnlyKeyValue right, int rowCommonPrefix) -
findCommonPrefixInFamilyPart
private static int findCommonPrefixInFamilyPart(Cell left, KeyValue.KeyOnlyKeyValue right, int familyCommonPrefix) -
findCommonPrefixInQualifierPart
private static int findCommonPrefixInQualifierPart(Cell left, KeyValue.KeyOnlyKeyValue right, int qualifierCommonPrefix) -
moveToPrevious
-
createSeekerState
-
decodeFirst
-
decodeNext
-