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_BYTESFields inherited from interface org.apache.hadoop.hbase.regionserver.KeyValueScanner
NO_NEXT_INDEXED_KEY -
Constructor Summary
ConstructorsConstructorDescriptionReversedStoreScanner(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 TypeMethodDescriptionbooleanbackwardSeek(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 voidcheckScanOrder(Cell prevKV, Cell kv, CellComparator comparator) Check whether scan as expected orderprotected KeyValueHeapnewKVHeap(List<? extends KeyValueScanner> scanners, CellComparator comparator) booleanReseek the scanner at or after the specified KeyValue.booleanSeek the scanner at or after the specified KeyValue.protected booleanseekAsDirection(Cell kv) Do a backwardSeek in a reversed StoreScanner(scan backward)protected voidseekScanners(List<? extends KeyValueScanner> scanners, Cell seekKey, boolean isLazy, boolean isParallelSeek) Seek the specified scanners with the given keyprotected booleanseekToNextRow(Cell kv) booleanseekToPreviousRow(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, updateReadersMethods inherited from class org.apache.hadoop.hbase.regionserver.NonReversedNonLazyKeyValueScanner
seekToLastRowMethods inherited from class org.apache.hadoop.hbase.regionserver.NonLazyKeyValueScanner
doRealSeek, enforceSeek, getFilePath, isFileScanner, realSeekDone, recordBlockSize, requestSeek, shouldUseScannerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.regionserver.InternalScanner
nextMethods 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:
newKVHeapin classStoreScanner- Throws:
IOException
-
seekScanners
protected void seekScanners(List<? extends KeyValueScanner> scanners, Cell seekKey, boolean isLazy, boolean isParallelSeek) throws IOException Description copied from class:StoreScannerSeek the specified scanners with the given key- Overrides:
seekScannersin classStoreScannerisLazy- true if using lazy seekisParallelSeek- true if using parallel seek- Throws:
IOException
-
seekToNextRow
- Overrides:
seekToNextRowin classStoreScanner- Throws:
IOException
-
seekAsDirection
Do a backwardSeek in a reversed StoreScanner(scan backward)- Overrides:
seekAsDirectionin classStoreScanner- Returns:
- true if scanner has values left, false if end of scanner
- Throws:
IOException
-
checkScanOrder
Description copied from class:StoreScannerCheck whether scan as expected order- Overrides:
checkScanOrderin classStoreScanner- Throws:
IOException
-
reseek
Description copied from interface:KeyValueScannerReseek 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:
reseekin interfaceKeyValueScanner- Overrides:
reseekin 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:KeyValueScannerSeek the scanner at or after the specified KeyValue.- Specified by:
seekin interfaceKeyValueScanner- Overrides:
seekin classStoreScanner- Parameters:
key- seek value- Returns:
- true if scanner has values left, false if end of scanner
- Throws:
IOException
-
seekToPreviousRow
Description copied from interface:KeyValueScannerSeek the scanner at the first Cell of the row which is the previous row of specified key- Specified by:
seekToPreviousRowin interfaceKeyValueScanner- Overrides:
seekToPreviousRowin 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:KeyValueScannerSeek 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:
backwardSeekin interfaceKeyValueScanner- Overrides:
backwardSeekin classNonReversedNonLazyKeyValueScanner- Parameters:
key- seek KeyValue- Returns:
- true if the scanner is at the valid KeyValue, false if such KeyValue does not exist
- Throws:
IOException
-