@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().KeyValueHeap.KVScannerComparator
comparator, current, heap
NO_NEXT_INDEXED_KEY
Constructor and Description |
---|
ReversedKeyValueHeap(List<? extends KeyValueScanner> scanners,
KeyValue.KVComparator comparator) |
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, getHeap, getNextIndexedKey, getScannerOrder, next, next, peek, pollRealKV
doRealSeek, enforceSeek, isFileScanner, realSeekDone, shouldUseScanner
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
enforceSeek, isFileScanner, realSeekDone, shouldUseScanner
public ReversedKeyValueHeap(List<? extends KeyValueScanner> scanners, KeyValue.KVComparator comparator) throws IOException
scanners
- comparator
- 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–2019 The Apache Software Foundation. All rights reserved.