Class ReversedStoreScanner
java.lang.Object
org.apache.hadoop.hbase.regionserver.NonLazyKeyValueScanner
org.apache.hadoop.hbase.regionserver.NonReversedNonLazyKeyValueScanner
org.apache.hadoop.hbase.regionserver.StoreScanner
org.apache.hadoop.hbase.regionserver.ReversedStoreScanner
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ChangedReadersObserver
,InternalScanner
,KeyValueScanner
,Shipper
- Direct Known Subclasses:
ReversedMobStoreScanner
ReversedStoreScanner extends from StoreScanner, and is used to support reversed scanning.
-
Field Summary
Fields inherited from class org.apache.hadoop.hbase.regionserver.StoreScanner
currentScanners, DEFAULT_HBASE_CELLS_SCANNED_PER_HEARTBEAT_CHECK, HBASE_CELLS_SCANNED_PER_HEARTBEAT_CHECK, heap, LAZY_SEEK_ENABLED_BY_DEFAULT, memstoreOnlyReads, mixedReads, readPt, store, STORESCANNER_PARALLEL_SEEK_ENABLE, STORESCANNER_PREAD_MAX_BYTES
Fields inherited from interface org.apache.hadoop.hbase.regionserver.KeyValueScanner
NO_NEXT_INDEXED_KEY
-
Constructor Summary
ConstructorDescriptionReversedStoreScanner
(Scan scan, ScanInfo scanInfo, NavigableSet<byte[]> columns, List<? extends KeyValueScanner> scanners) Constructor for testing.ReversedStoreScanner
(HStore store, ScanInfo scanInfo, Scan scan, NavigableSet<byte[]> columns, long readPt) Opens a scanner across memstore, snapshot, and all StoreFiles. -
Method Summary
Modifier and TypeMethodDescriptionboolean
backwardSeek
(Cell key) 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 KeyValueprotected void
checkScanOrder
(Cell prevKV, Cell kv, CellComparator comparator) Check whether scan as expected orderprotected KeyValueHeap
newKVHeap
(List<? extends KeyValueScanner> scanners, CellComparator comparator) boolean
Reseek the scanner at or after the specified KeyValue.boolean
Seek the scanner at or after the specified KeyValue.protected boolean
seekAsDirection
(Cell kv) Do a backwardSeek in a reversed StoreScanner(scan backward)protected void
seekScanners
(List<? extends KeyValueScanner> scanners, Cell seekKey, boolean isLazy, boolean isParallelSeek) Seek the specified scanners with the given keyprotected boolean
seekToNextRow
(Cell kv) boolean
seekToPreviousRow
(Cell key) Seek the scanner at the first Cell of the row which is the previous row of specified keyMethods inherited from class org.apache.hadoop.hbase.regionserver.StoreScanner
checkFlushed, close, enableLazySeekGlobally, getAllScannersForTesting, getEstimatedNumberOfKvsScanned, getNextIndexedKey, getReadPoint, isScanUsePread, next, next, peek, reopenAfterFlush, resetKVHeap, selectScannersFrom, shipped, trySkipToNextColumn, trySkipToNextRow, trySwitchToStreamRead, updateReaders
Methods inherited from class org.apache.hadoop.hbase.regionserver.NonReversedNonLazyKeyValueScanner
seekToLastRow
Methods inherited from class org.apache.hadoop.hbase.regionserver.NonLazyKeyValueScanner
doRealSeek, enforceSeek, getFilePath, isFileScanner, realSeekDone, recordBlockSize, requestSeek, shouldUseScanner
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.hadoop.hbase.regionserver.InternalScanner
next
Methods inherited from interface org.apache.hadoop.hbase.regionserver.KeyValueScanner
close, enforceSeek, getFilePath, getNextIndexedKey, getScannerOrder, isFileScanner, next, peek, realSeekDone, recordBlockSize, requestSeek, seekToLastRow, shouldUseScanner
-
Constructor Details
-
Method Details
-
newKVHeap
protected KeyValueHeap newKVHeap(List<? extends KeyValueScanner> scanners, CellComparator comparator) throws IOException - Overrides:
newKVHeap
in classStoreScanner
- Throws:
IOException
-
seekScanners
protected void seekScanners(List<? extends KeyValueScanner> scanners, Cell seekKey, boolean isLazy, boolean isParallelSeek) throws IOException Description copied from class:StoreScanner
Seek the specified scanners with the given key- Overrides:
seekScanners
in classStoreScanner
isLazy
- true if using lazy seekisParallelSeek
- true if using parallel seek- Throws:
IOException
-
seekToNextRow
- Overrides:
seekToNextRow
in classStoreScanner
- Throws:
IOException
-
seekAsDirection
Do a backwardSeek in a reversed StoreScanner(scan backward)- Overrides:
seekAsDirection
in classStoreScanner
- Returns:
- true if scanner has values left, false if end of scanner
- Throws:
IOException
-
checkScanOrder
Description copied from class:StoreScanner
Check whether scan as expected order- Overrides:
checkScanOrder
in classStoreScanner
- Throws:
IOException
-
reseek
Description copied from interface:KeyValueScanner
Reseek the scanner at or after the specified KeyValue. This method is guaranteed to seek at or after the required key only if the key comes after the current position of the scanner. Should not be used to seek to a key which may come before the current position.- Specified by:
reseek
in interfaceKeyValueScanner
- Overrides:
reseek
in classStoreScanner
- Parameters:
kv
- seek value (should be non-null)- Returns:
- true if scanner has values left, false if end of scanner
- Throws:
IOException
-
seek
Description copied from interface:KeyValueScanner
Seek the scanner at or after the specified KeyValue.- Specified by:
seek
in interfaceKeyValueScanner
- Overrides:
seek
in classStoreScanner
- Parameters:
key
- seek value- Returns:
- true if scanner has values left, false if end of scanner
- Throws:
IOException
-
seekToPreviousRow
Description copied from interface:KeyValueScanner
Seek the scanner at the first Cell of the row which is the previous row of specified key- Specified by:
seekToPreviousRow
in interfaceKeyValueScanner
- Overrides:
seekToPreviousRow
in classNonReversedNonLazyKeyValueScanner
- Parameters:
key
- seek value- Returns:
- true if the scanner at the first valid Cell of previous row, false if not existing such Cell
- Throws:
IOException
-
backwardSeek
Description copied from interface:KeyValueScanner
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- Specified by:
backwardSeek
in interfaceKeyValueScanner
- Overrides:
backwardSeek
in classNonReversedNonLazyKeyValueScanner
- Parameters:
key
- seek KeyValue- Returns:
- true if the scanner is at the valid KeyValue, false if such KeyValue does not exist
- Throws:
IOException
-