protected abstract static class BufferedDataBlockEncoder.BufferedEncodedSeeker<STATE extends BufferedDataBlockEncoder.SeekerState> extends AbstractDataBlockEncoder.AbstractEncodedSeeker
Modifier and Type | Field and Description |
---|---|
protected STATE |
current |
protected ByteBuff |
currentBuffer |
protected KeyValue.KeyOnlyKeyValue |
keyOnlyKV |
protected STATE |
previous |
protected TagCompressionContext |
tagCompressionContext |
protected ObjectIntPair<ByteBuffer> |
tmpPair |
comparator, decodingCtx
Constructor and Description |
---|
BufferedEncodedSeeker(CellComparator comparator,
HFileBlockDecodingContext decodingCtx) |
Modifier and Type | Method and Description |
---|---|
int |
compareKey(CellComparator comparator,
Cell key)
Compare the given key against the current key
|
private int |
compareTypeBytes(Cell key,
Cell right) |
protected STATE |
createSeekerState() |
protected abstract void |
decodeFirst() |
protected abstract void |
decodeNext() |
protected void |
decodeTags() |
private static int |
findCommonPrefixInFamilyPart(Cell left,
Cell right,
int familyCommonPrefix) |
private static int |
findCommonPrefixInQualifierPart(Cell left,
Cell right,
int qualifierCommonPrefix) |
private static int |
findCommonPrefixInRowPart(Cell left,
Cell right,
int rowCommonPrefix) |
Cell |
getCell() |
Cell |
getKey()
From the current position creates a cell using the key part
of the current buffer
|
ByteBuffer |
getValueShallowCopy()
Does a shallow copy of the value at the current position.
|
private void |
moveToPrevious() |
boolean |
next()
Move to next position
|
void |
rewind()
Set position to beginning of given block
|
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(ByteBuff buffer)
Set on which buffer there will be done seeking.
|
includesMvcc, includesTags
protected ByteBuff currentBuffer
protected TagCompressionContext tagCompressionContext
protected KeyValue.KeyOnlyKeyValue keyOnlyKV
protected final ObjectIntPair<ByteBuffer> tmpPair
protected STATE extends BufferedDataBlockEncoder.SeekerState current
protected STATE extends BufferedDataBlockEncoder.SeekerState previous
public BufferedEncodedSeeker(CellComparator comparator, HFileBlockDecodingContext decodingCtx)
public int compareKey(CellComparator comparator, Cell key)
DataBlockEncoder.EncodedSeeker
public void setCurrentBuffer(ByteBuff buffer)
DataBlockEncoder.EncodedSeeker
buffer
- Used for seeking.public Cell getKey()
DataBlockEncoder.EncodedSeeker
public ByteBuffer getValueShallowCopy()
DataBlockEncoder.EncodedSeeker
public Cell getCell()
public void rewind()
DataBlockEncoder.EncodedSeeker
public boolean next()
DataBlockEncoder.EncodedSeeker
protected void decodeTags()
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.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 int compareTypeBytes(Cell key, Cell right)
private static int findCommonPrefixInRowPart(Cell left, Cell right, int rowCommonPrefix)
private static int findCommonPrefixInFamilyPart(Cell left, Cell right, int familyCommonPrefix)
private static int findCommonPrefixInQualifierPart(Cell left, Cell right, int qualifierCommonPrefix)
private void moveToPrevious()
protected STATE createSeekerState()
protected abstract void decodeFirst()
protected abstract void decodeNext()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.