@InterfaceAudience.LimitedPrivate(value="Phoenix") @InterfaceStability.Evolving public class StoreFileScanner extends Object implements KeyValueScanner
NO_NEXT_INDEXED_KEY| 构造器和说明 |
|---|
StoreFileScanner(StoreFileReader reader,
HFileScanner hfs,
boolean useMVCC,
boolean hasMVCC,
long readPt,
long scannerOrder,
boolean canOptimizeForNonNullColumn)
Implements a
KeyValueScanner on top of the specified HFileScanner |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
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 KeyValue
|
void |
close()
Close the KeyValue scanner.
|
void |
enforceSeek()
Does the real seek operation in case it was skipped by
seekToRowCol(KeyValue, boolean) (TODO: Whats this?).
|
org.apache.hadoop.fs.Path |
getFilePath() |
Cell |
getNextIndexedKey() |
long |
getScannerOrder()
Get the order of this KeyValueScanner.
|
static List<StoreFileScanner> |
getScannersForCompaction(Collection<HStoreFile> files,
boolean canUseDropBehind,
long readPt)
Get scanners for compaction.
|
static List<StoreFileScanner> |
getScannersForStoreFiles(Collection<HStoreFile> files,
boolean cacheBlocks,
boolean usePread,
boolean isCompaction,
boolean useDropBehind,
long readPt)
Return an array of scanners corresponding to the given set of store files.
|
static List<StoreFileScanner> |
getScannersForStoreFiles(Collection<HStoreFile> files,
boolean cacheBlocks,
boolean usePread,
boolean isCompaction,
boolean canUseDrop,
ScanQueryMatcher matcher,
long readPt)
Return an array of scanners corresponding to the given set of store files, And set the
ScanQueryMatcher for each store file scanner for further optimization
|
static List<StoreFileScanner> |
getScannersForStoreFiles(Collection<HStoreFile> files,
boolean cacheBlocks,
boolean usePread,
long readPt)
Return an array of scanners corresponding to the given set of store files.
|
boolean |
isFileScanner() |
Cell |
next()
Return the next Cell in this scanner, iterating the scanner
|
Cell |
peek()
Look at the next Cell in this scanner, but do not iterate scanner.
|
boolean |
realSeekDone()
We optimize our store scanners by checking the most recent store file
first, so we sometimes pretend we have done a seek but delay it until the
store scanner bubbles up to the top of the key-value heap.
|
boolean |
requestSeek(Cell kv,
boolean forward,
boolean useBloom)
Pretend we have done a seek but don't do it yet, if possible.
|
boolean |
reseek(Cell key)
Reseek the scanner at or after the specified KeyValue.
|
boolean |
seek(Cell key)
Seek the scanner at or after the specified KeyValue.
|
static boolean |
seekAtOrAfter(HFileScanner s,
Cell k) |
boolean |
seekToLastRow()
Seek the scanner at the first KeyValue of last row
|
boolean |
seekToPreviousRow(Cell originalKey)
Seek the scanner at the first Cell of the row which is the previous row
of specified key
|
protected void |
setCurrentCell(Cell newVal) |
void |
shipped()
Called after a batch of rows scanned and set to be returned to client.
|
boolean |
shouldUseScanner(Scan scan,
HStore store,
long oldestUnexpiredTS)
Allows to filter out scanners (both StoreFile and memstore) that we don't
want to use based on criteria such as Bloom filters and timestamp ranges.
|
protected boolean |
skipKVsNewerThanReadpoint() |
String |
toString() |
public StoreFileScanner(StoreFileReader reader, HFileScanner hfs, boolean useMVCC, boolean hasMVCC, long readPt, long scannerOrder, boolean canOptimizeForNonNullColumn)
KeyValueScanner on top of the specified HFileScanneruseMVCC - If true, scanner will filter out updates with MVCC larger than readPt.readPt - MVCC value to use to filter out the updates newer than this scanner.hasMVCC - Set to true if underlying store file reader has MVCC info.scannerOrder - Order of the scanner relative to other scanners. See
KeyValueScanner.getScannerOrder().canOptimizeForNonNullColumn - true if we can make sure there is no null column,
otherwise false. This is a hint for optimization.public static List<StoreFileScanner> getScannersForStoreFiles(Collection<HStoreFile> files, boolean cacheBlocks, boolean usePread, long readPt) throws IOException
IOExceptionpublic static List<StoreFileScanner> getScannersForStoreFiles(Collection<HStoreFile> files, boolean cacheBlocks, boolean usePread, boolean isCompaction, boolean useDropBehind, long readPt) throws IOException
IOExceptionpublic static List<StoreFileScanner> getScannersForStoreFiles(Collection<HStoreFile> files, boolean cacheBlocks, boolean usePread, boolean isCompaction, boolean canUseDrop, ScanQueryMatcher matcher, long readPt) throws IOException
IOExceptionpublic static List<StoreFileScanner> getScannersForCompaction(Collection<HStoreFile> files, boolean canUseDropBehind, long readPt) throws IOException
IOExceptionpublic Cell peek()
KeyValueScannerpeek 在接口中 KeyValueScannerpublic Cell next() throws IOException
KeyValueScannernext 在接口中 KeyValueScannerIOExceptionpublic boolean seek(Cell key) throws IOException
KeyValueScannerseek 在接口中 KeyValueScannerkey - seek valueIOExceptionpublic boolean reseek(Cell key) throws IOException
KeyValueScannerreseek 在接口中 KeyValueScannerkey - seek value (should be non-null)IOExceptionprotected void setCurrentCell(Cell newVal) throws IOException
IOExceptionprotected boolean skipKVsNewerThanReadpoint()
throws IOException
IOExceptionpublic void close()
KeyValueScannerclose 在接口中 Closeableclose 在接口中 AutoCloseableclose 在接口中 KeyValueScannerpublic static boolean seekAtOrAfter(HFileScanner s, Cell k) throws IOException
s - k - IOExceptionpublic long getScannerOrder()
KeyValueScannergetScannerOrder 在接口中 KeyValueScannerKeyValueScanner.getScannerOrder()public boolean requestSeek(Cell kv, boolean forward, boolean useBloom) throws IOException
enforceSeek().
Note that this function does guarantee that the current KV of this scanner will be advanced to at least the given KV. Because of this, it does have to do a real seek in cases when the seek timestamp is older than the highest timestamp of the file, e.g. when we are trying to seek to the next row/column and use OLDEST_TIMESTAMP in the seek key.
requestSeek 在接口中 KeyValueScannerforward - do a forward-only "reseek" instead of a random-access seekuseBloom - whether to enable multi-column Bloom filter optimizationIOExceptionpublic boolean realSeekDone()
KeyValueScannerrealSeekDone 在接口中 KeyValueScannerpublic void enforceSeek()
throws IOException
KeyValueScannerKeyValueScanner.realSeekDone() first.enforceSeek 在接口中 KeyValueScannerIOExceptionpublic boolean isFileScanner()
isFileScanner 在接口中 KeyValueScannerpublic org.apache.hadoop.fs.Path getFilePath()
getFilePath 在接口中 KeyValueScannerKeyValueScanner.isFileScanner()public boolean shouldUseScanner(Scan scan, HStore store, long oldestUnexpiredTS)
KeyValueScannershouldUseScanner 在接口中 KeyValueScannerscan - the scan that we are selecting scanners forstore - the store we are performing the scan on.oldestUnexpiredTS - the oldest timestamp we are interested in for
this query, based on TTLpublic boolean seekToPreviousRow(Cell originalKey) throws IOException
KeyValueScannerseekToPreviousRow 在接口中 KeyValueScanneroriginalKey - seek valueIOExceptionpublic boolean seekToLastRow()
throws IOException
KeyValueScannerseekToLastRow 在接口中 KeyValueScannerIOExceptionpublic boolean backwardSeek(Cell key) throws IOException
KeyValueScannerbackwardSeek 在接口中 KeyValueScannerkey - seek KeyValueIOExceptionpublic Cell getNextIndexedKey()
getNextIndexedKey 在接口中 KeyValueScannerpublic void shipped()
throws IOException
Shippershipped 在接口中 ShipperIOExceptionCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.