@InterfaceAudience.LimitedPrivate(value="Coprocessor") public class StoreFileScanner extends java.lang.Object implements KeyValueScanner
| Constructor and Description |
|---|
StoreFileScanner(StoreFile.Reader reader,
HFileScanner hfs,
boolean useMVCC,
boolean hasMVCC,
long readPt)
Implements a
KeyValueScanner on top of the specified HFileScanner |
| Modifier and Type | Method and Description |
|---|---|
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?).
|
Cell |
getNextIndexedKey() |
static java.util.List<StoreFileScanner> |
getScannersForStoreFiles(java.util.Collection<StoreFile> files,
boolean cacheBlocks,
boolean usePread,
boolean isCompaction,
long readPt)
Return an array of scanners corresponding to the given set of store files.
|
static java.util.List<StoreFileScanner> |
getScannersForStoreFiles(java.util.Collection<StoreFile> files,
boolean cacheBlocks,
boolean usePread,
boolean isCompaction,
ScanQueryMatcher matcher,
long readPt) |
static java.util.List<StoreFileScanner> |
getScannersForStoreFiles(java.util.Collection<StoreFile> files,
boolean cacheBlocks,
boolean usePread,
boolean isCompaction,
ScanQueryMatcher matcher,
long readPt,
boolean isPrimaryReplica)
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 java.util.List<StoreFileScanner> |
getScannersForStoreFiles(java.util.Collection<StoreFile> files,
boolean cacheBlocks,
boolean usePread,
long readPt)
Return an array of scanners corresponding to the given
set of store files.
|
long |
getSequenceID()
Get the sequence id associated with this KeyValueScanner.
|
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 |
setScanQueryMatcher(ScanQueryMatcher matcher) |
boolean |
shouldUseScanner(Scan scan,
java.util.SortedSet<byte[]> columns,
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() |
java.lang.String |
toString() |
public StoreFileScanner(StoreFile.Reader reader, HFileScanner hfs, boolean useMVCC, boolean hasMVCC, long readPt)
KeyValueScanner on top of the specified HFileScannerhfs - HFile scannerpublic static java.util.List<StoreFileScanner> getScannersForStoreFiles(java.util.Collection<StoreFile> files, boolean cacheBlocks, boolean usePread, long readPt) throws java.io.IOException
java.io.IOExceptionpublic static java.util.List<StoreFileScanner> getScannersForStoreFiles(java.util.Collection<StoreFile> files, boolean cacheBlocks, boolean usePread, boolean isCompaction, long readPt) throws java.io.IOException
java.io.IOExceptionpublic static java.util.List<StoreFileScanner> getScannersForStoreFiles(java.util.Collection<StoreFile> files, boolean cacheBlocks, boolean usePread, boolean isCompaction, ScanQueryMatcher matcher, long readPt, boolean isPrimaryReplica) throws java.io.IOException
java.io.IOExceptionpublic static java.util.List<StoreFileScanner> getScannersForStoreFiles(java.util.Collection<StoreFile> files, boolean cacheBlocks, boolean usePread, boolean isCompaction, ScanQueryMatcher matcher, long readPt) throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic Cell peek()
KeyValueScannerpeek in interface KeyValueScannerpublic Cell next() throws java.io.IOException
KeyValueScannernext in interface KeyValueScannerjava.io.IOExceptionpublic boolean seek(Cell key) throws java.io.IOException
KeyValueScannerseek in interface KeyValueScannerkey - seek valuejava.io.IOExceptionpublic boolean reseek(Cell key) throws java.io.IOException
KeyValueScannerreseek in interface KeyValueScannerkey - seek value (should be non-null)java.io.IOExceptionprotected void setCurrentCell(Cell newVal) throws java.io.IOException
java.io.IOExceptionprotected boolean skipKVsNewerThanReadpoint()
throws java.io.IOException
java.io.IOExceptionpublic void close()
KeyValueScannerclose in interface KeyValueScannerpublic static boolean seekAtOrAfter(HFileScanner s, Cell k) throws java.io.IOException
s - k - java.io.IOExceptionpublic long getSequenceID()
KeyValueScannergetSequenceID in interface KeyValueScannerpublic boolean requestSeek(Cell kv, boolean forward, boolean useBloom) throws java.io.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 in interface KeyValueScannerforward - do a forward-only "reseek" instead of a random-access seekuseBloom - whether to enable multi-column Bloom filter optimizationjava.io.IOExceptionpublic boolean realSeekDone()
KeyValueScannerrealSeekDone in interface KeyValueScannerpublic void enforceSeek()
throws java.io.IOException
KeyValueScannerKeyValueScanner.realSeekDone() first.enforceSeek in interface KeyValueScannerjava.io.IOExceptionpublic void setScanQueryMatcher(ScanQueryMatcher matcher)
public boolean isFileScanner()
isFileScanner in interface KeyValueScannerpublic boolean shouldUseScanner(Scan scan, java.util.SortedSet<byte[]> columns, long oldestUnexpiredTS)
KeyValueScannershouldUseScanner in interface KeyValueScannerscan - the scan that we are selecting scanners forcolumns - the set of columns in the current column family, or null if
not specified by the scanoldestUnexpiredTS - the oldest timestamp we are interested in for
this query, based on TTLpublic boolean seekToPreviousRow(Cell originalKey) throws java.io.IOException
KeyValueScannerseekToPreviousRow in interface KeyValueScanneroriginalKey - seek valuejava.io.IOExceptionpublic boolean seekToLastRow()
throws java.io.IOException
KeyValueScannerseekToLastRow in interface KeyValueScannerjava.io.IOExceptionpublic boolean backwardSeek(Cell key) throws java.io.IOException
KeyValueScannerbackwardSeek in interface KeyValueScannerkey - seek KeyValuejava.io.IOExceptionpublic Cell getNextIndexedKey()
getNextIndexedKey in interface KeyValueScanner