@InterfaceAudience.Private public class RowIndexSeekerV1 extends AbstractDataBlockEncoder.AbstractEncodedSeeker
Modifier and Type | Class and Description |
---|---|
private class |
RowIndexSeekerV1.SeekerState |
Modifier and Type | Field and Description |
---|---|
private CellComparator |
cellComparator |
private RowIndexSeekerV1.SeekerState |
current |
private ByteBuff |
currentBuffer |
private RowIndexSeekerV1.SeekerState |
previous |
private int |
rowNumber |
private ByteBuff |
rowOffsets |
protected ObjectIntPair<ByteBuffer> |
tmpPair |
decodingCtx
Constructor and Description |
---|
RowIndexSeekerV1(HFileBlockDecodingContext decodingCtx) |
Modifier and Type | Method and Description |
---|---|
private int |
binarySearch(Cell seekCell,
boolean seekBefore) |
int |
compareKey(CellComparator comparator,
Cell key)
Compare the given key against the current key
|
protected void |
decodeAtPosition(int position) |
protected void |
decodeFirst() |
protected void |
decodeNext() |
protected void |
decodeTags() |
Cell |
getCell()
Returns the Cell at the current position.
|
Cell |
getKey()
From the current position creates a cell using the key part of the current buffer
|
private ByteBuffer |
getRow(int index) |
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 final ObjectIntPair<ByteBuffer> tmpPair
private ByteBuff currentBuffer
private RowIndexSeekerV1.SeekerState current
private RowIndexSeekerV1.SeekerState previous
private int rowNumber
private ByteBuff rowOffsets
private final CellComparator cellComparator
public RowIndexSeekerV1(HFileBlockDecodingContext decodingCtx)
public void setCurrentBuffer(ByteBuff buffer)
DataBlockEncoder.EncodedSeeker
buffer
- Used for seeking.public Cell getKey()
DataBlockEncoder.EncodedSeeker
public ByteBuffer getValueShallowCopy()
DataBlockEncoder.EncodedSeeker
public Cell getCell()
DataBlockEncoder.EncodedSeeker
public void rewind()
DataBlockEncoder.EncodedSeeker
public boolean next()
DataBlockEncoder.EncodedSeeker
private int binarySearch(Cell seekCell, boolean seekBefore)
private ByteBuffer getRow(int index)
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 void moveToPrevious()
public int compareKey(CellComparator comparator, Cell key)
DataBlockEncoder.EncodedSeeker
protected void decodeFirst()
protected void decodeAtPosition(int position)
protected void decodeNext()
protected void decodeTags()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.