@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.KVScannerComparatorcomparator, current, heapNO_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, getCurrentForTesting, getHeap, getNextIndexedKey, getSequenceID, next, next, peek, pollRealKVdoRealSeek, enforceSeek, isFileScanner, realSeekDone, shouldUseScannerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitenforceSeek, isFileScanner, realSeekDone, shouldUseScannerpublic ReversedKeyValueHeap(List<? extends KeyValueScanner> scanners, KeyValue.KVComparator comparator) throws IOException
scanners - comparator - IOExceptionpublic boolean seek(Cell seekKey) throws IOException
KeyValueHeapAs 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 KeyValueScannerseek in class KeyValueHeapseekKey - KeyValue to seek at or afterIOExceptionpublic boolean reseek(Cell seekKey) throws IOException
KeyValueHeapKeyValueHeap.seek(Cell) function except
that scanner.seek(seekKey) is changed to scanner.reseek(seekKey).reseek in interface KeyValueScannerreseek in class KeyValueHeapseekKey - seek value (should be non-null)IOExceptionpublic boolean requestSeek(Cell key, boolean forward, boolean useBloom) throws IOException
KeyValueHeapKeyValueScanner.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 KeyValueScannerrequestSeek in class KeyValueHeapforward - do a forward-only "reseek" instead of a random-access seekuseBloom - whether to enable multi-column Bloom filter optimizationIOExceptionpublic boolean seekToPreviousRow(Cell seekKey) throws IOException
KeyValueScannerseekToPreviousRow in interface KeyValueScannerseekToPreviousRow in class NonReversedNonLazyKeyValueScannerseekKey - seek valueIOExceptionpublic boolean backwardSeek(Cell seekKey) throws IOException
KeyValueScannerbackwardSeek in interface KeyValueScannerbackwardSeek in class NonReversedNonLazyKeyValueScannerseekKey - seek KeyValueIOExceptionpublic Cell next() throws IOException
KeyValueScannernext in interface KeyValueScannernext in class KeyValueHeapIOExceptionpublic boolean seekToLastRow()
throws IOException
KeyValueScannerseekToLastRow in interface KeyValueScannerseekToLastRow in class NonReversedNonLazyKeyValueScannerIOExceptionCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.