@InterfaceAudience.Private public class ReversedKeyValueHeap extends KeyValueHeap
KeyValueScanner.backwardSeek(org.apache.hadoop.hbase.Cell)
), and it will jump to the previous row if it is
already at the end of one row when calling next().Modifier and Type | Class and Description |
---|---|
private static class |
ReversedKeyValueHeap.ReversedKVScannerComparator
In ReversedKVScannerComparator, we compare the row of scanners' peek values first, sort bigger
one before the smaller one.
|
KeyValueHeap.KVScannerComparator
comparator, current, heap, scannersForDelayedClose
NO_NEXT_INDEXED_KEY
Constructor and Description |
---|
ReversedKeyValueHeap(List<? extends KeyValueScanner> scanners,
CellComparator comparator)
nnn
|
Modifier and Type | Method and Description |
---|---|
boolean |
backwardSeek(Cell seekKey)
Seek the scanner at or before the row of specified Cell, it firstly tries to seek the scanner
at or after the specified Cell, return if peek KeyValue of scanner has the same row with
specified Cell, otherwise seek the scanner at the first Cell of the row which is the previous
row of specified KeyValue
|
Cell |
next()
Return the next Cell in this scanner, iterating the scanner
|
boolean |
requestSeek(Cell key,
boolean forward,
boolean useBloom)
Similar to
KeyValueScanner.seek(org.apache.hadoop.hbase.Cell) (or KeyValueScanner.reseek(org.apache.hadoop.hbase.Cell) if forward is true) but only does a seek operation
after checking that it is really necessary for the row/column combination specified by the kv
parameter. |
boolean |
reseek(Cell seekKey)
This function is identical to the
KeyValueHeap.seek(Cell) function except that
scanner.seek(seekKey) is changed to scanner.reseek(seekKey). |
boolean |
seek(Cell seekKey)
Seeks all scanners at or below the specified seek key.
|
boolean |
seekToLastRow()
Seek the scanner at the first KeyValue of last row
|
boolean |
seekToPreviousRow(Cell seekKey)
Seek the scanner at the first Cell of the row which is the previous row of specified key
|
close, getCurrentForTesting, getHeap, getNextIndexedKey, isLatestCellFromMemstore, next, peek, pollRealKV, shipped
doRealSeek, enforceSeek, getFilePath, isFileScanner, realSeekDone, shouldUseScanner
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
enforceSeek, getFilePath, getScannerOrder, isFileScanner, realSeekDone, shouldUseScanner
next
public ReversedKeyValueHeap(List<? extends KeyValueScanner> scanners, CellComparator comparator) throws IOException
IOException
public boolean seek(Cell seekKey) throws IOException
KeyValueHeap
As individual scanners may run past their ends, those scanners are automatically closed and removed from the heap.
This function (and KeyValueHeap.reseek(Cell)
) does not do multi-column Bloom filter and lazy-seek
optimizations. To enable those, call KeyValueHeap.requestSeek(Cell, boolean, boolean)
.
seek
in interface KeyValueScanner
seek
in class KeyValueHeap
seekKey
- KeyValue to seek at or afterIOException
public boolean reseek(Cell seekKey) throws IOException
KeyValueHeap
KeyValueHeap.seek(Cell)
function except that
scanner.seek(seekKey) is changed to scanner.reseek(seekKey).reseek
in interface KeyValueScanner
reseek
in class KeyValueHeap
seekKey
- seek value (should be non-null)IOException
public boolean requestSeek(Cell key, boolean forward, boolean useBloom) throws IOException
KeyValueHeap
KeyValueScanner.seek(org.apache.hadoop.hbase.Cell)
(or KeyValueScanner.reseek(org.apache.hadoop.hbase.Cell)
if forward is true) but only does a seek operation
after checking that it is really necessary for the row/column combination specified by the kv
parameter. This function was added to avoid unnecessary disk seeks by checking row-column Bloom
filters before a seek on multi-column get/scan queries, and to optimize by looking up more
recent files first.requestSeek
in interface KeyValueScanner
requestSeek
in class KeyValueHeap
forward
- do a forward-only "reseek" instead of a random-access seekuseBloom
- whether to enable multi-column Bloom filter optimizationIOException
public boolean seekToPreviousRow(Cell seekKey) throws IOException
KeyValueScanner
seekToPreviousRow
in interface KeyValueScanner
seekToPreviousRow
in class NonReversedNonLazyKeyValueScanner
seekKey
- seek valueIOException
public boolean backwardSeek(Cell seekKey) throws IOException
KeyValueScanner
backwardSeek
in interface KeyValueScanner
backwardSeek
in class NonReversedNonLazyKeyValueScanner
seekKey
- seek KeyValueIOException
public Cell next() throws IOException
KeyValueScanner
next
in interface KeyValueScanner
next
in class KeyValueHeap
IOException
public boolean seekToLastRow() throws IOException
KeyValueScanner
seekToLastRow
in interface KeyValueScanner
seekToLastRow
in class NonReversedNonLazyKeyValueScanner
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.