Class RowIndexSeekerV1
java.lang.Object
org.apache.hadoop.hbase.io.encoding.AbstractDataBlockEncoder.AbstractEncodedSeeker
org.apache.hadoop.hbase.io.encoding.RowIndexSeekerV1
- All Implemented Interfaces:
DataBlockEncoder.EncodedSeeker
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate final CellComparator
private RowIndexSeekerV1.SeekerState
private ByteBuff
private RowIndexSeekerV1.SeekerState
private int
private ByteBuff
protected final ObjectIntPair<ByteBuffer>
Fields inherited from class org.apache.hadoop.hbase.io.encoding.AbstractDataBlockEncoder.AbstractEncodedSeeker
decodingCtx
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate int
binarySearch
(Cell seekCell, boolean seekBefore) int
compareKey
(CellComparator comparator, Cell key) Compare the given key against the current keyprotected void
decodeAtPosition
(int position) protected void
protected void
protected void
getCell()
Returns the Cell at the current position.getKey()
From the current position creates a cell using the key part of the current bufferprivate ByteBuffer
getRow
(int index) Does a shallow copy of the value at the current position.private void
boolean
next()
Move to next positionvoid
rewind()
Set position to beginning of given blockint
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 ifseekBefore
is false the last key that is strictly less than the given key ifseekBefore
is true.void
setCurrentBuffer
(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
-
tmpPair
-
currentBuffer
-
current
-
previous
-
rowNumber
-
rowOffsets
-
cellComparator
-
-
Constructor Details
-
RowIndexSeekerV1
-
-
Method Details
-
setCurrentBuffer
Description copied from interface:DataBlockEncoder.EncodedSeeker
Set on which buffer there will be done seeking.- Parameters:
buffer
- Used for seeking.
-
getKey
Description copied from interface:DataBlockEncoder.EncodedSeeker
From 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.EncodedSeeker
Does 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.EncodedSeeker
Returns the Cell at the current position. Includes memstore timestamp. -
rewind
Description copied from interface:DataBlockEncoder.EncodedSeeker
Set position to beginning of given block -
next
Description copied from interface:DataBlockEncoder.EncodedSeeker
Move to next position- Returns:
- true on success, false if there is no more positions.
-
binarySearch
-
getRow
-
seekToKeyInBlock
Description copied from interface:DataBlockEncoder.EncodedSeeker
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. 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
-
moveToPrevious
-
compareKey
Description copied from interface:DataBlockEncoder.EncodedSeeker
Compare 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
-
decodeFirst
-
decodeAtPosition
-
decodeNext
-
decodeTags
-