@InterfaceAudience.Private public class StoreScanner extends NonReversedNonLazyKeyValueScanner implements KeyValueScanner, InternalScanner, ChangedReadersObserver
Modifier and Type | Field and Description |
---|---|
protected boolean |
cacheBlocks |
protected boolean |
closing |
protected NavigableSet<byte[]> |
columns |
protected int |
countPerRow |
protected ExecutorService |
executor |
protected boolean |
explicitColumnQuery |
protected KeyValueHeap |
heap |
protected boolean |
isGet |
protected boolean |
isParallelSeekEnabled
A flag that enables StoreFileScanner parallel-seeking
|
protected KeyValue |
lastTop |
protected static boolean |
lazySeekEnabledGlobally
Used during unit testing to ensure that lazy seek does save seek ops
|
protected ReentrantLock |
lock |
protected ScanQueryMatcher |
matcher |
protected int |
minVersions |
protected long |
oldestUnexpiredTS |
protected Scan |
scan |
protected Store |
store |
protected int |
storeLimit |
protected int |
storeOffset |
static String |
STORESCANNER_PARALLEL_SEEK_ENABLE |
protected boolean |
useRowColBloom |
Modifier | Constructor and Description |
---|---|
protected |
StoreScanner(Store store,
boolean cacheBlocks,
Scan scan,
NavigableSet<byte[]> columns,
long ttl,
int minVersions,
long readPt)
An internal constructor.
|
|
StoreScanner(Store store,
ScanInfo scanInfo,
Scan scan,
List<? extends KeyValueScanner> scanners,
long smallestReadPoint,
long earliestPutTs,
byte[] dropDeletesFromRow,
byte[] dropDeletesToRow)
Used for compactions that drop deletes from a limited range of rows.
|
|
StoreScanner(Store store,
ScanInfo scanInfo,
Scan scan,
List<? extends KeyValueScanner> scanners,
ScanType scanType,
long smallestReadPoint,
long earliestPutTs)
Used for compactions.
|
|
StoreScanner(Store store,
ScanInfo scanInfo,
Scan scan,
NavigableSet<byte[]> columns,
long readPt)
Opens a scanner across memstore, snapshot, and all StoreFiles.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkReseek() |
protected void |
checkScanOrder(KeyValue prevKV,
KeyValue kv,
KeyValue.KVComparator comparator)
Check whether scan as expected order
|
void |
close()
Close the KeyValue scanner.
|
long |
getEstimatedNumberOfKvsScanned() |
protected List<KeyValueScanner> |
getScannersNoCompaction()
Get a filtered list of scanners.
|
long |
getSequenceID()
Get the sequence id associated with this KeyValueScanner.
|
KeyValue |
next()
Return the next KeyValue in this scanner, iterating the scanner
|
boolean |
next(List<Cell> outResult)
Grab the next row's worth of values.
|
boolean |
next(List<Cell> outResult,
int limit)
Get the next row of values from this Store.
|
KeyValue |
peek()
Look at the next KeyValue in this scanner, but do not iterate scanner.
|
boolean |
reseek(KeyValue kv)
Reseek the scanner at or after the specified KeyValue.
|
protected void |
resetKVHeap(List<? extends KeyValueScanner> scanners,
KeyValue.KVComparator comparator) |
protected void |
resetScannerStack(KeyValue lastTopKey) |
boolean |
seek(KeyValue key)
Seek the scanner at or after the specified KeyValue.
|
protected boolean |
seekAsDirection(KeyValue kv)
Do a reseek in a normal StoreScanner(scan forward)
|
protected void |
seekScanners(List<? extends KeyValueScanner> scanners,
KeyValue seekKey,
boolean isLazy,
boolean isParallelSeek)
Seek the specified scanners with the given key
|
protected boolean |
seekToNextRow(KeyValue kv) |
protected List<KeyValueScanner> |
selectScannersFrom(List<? extends KeyValueScanner> allScanners)
Filters the given list of scanners using Bloom filter, time range, and
TTL.
|
void |
updateReaders()
Notify observers.
|
backwardSeek, seekToLastRow, seekToPreviousRow
doRealSeek, enforceSeek, isFileScanner, realSeekDone, requestSeek, shouldUseScanner
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
backwardSeek, enforceSeek, isFileScanner, realSeekDone, requestSeek, seekToLastRow, seekToPreviousRow, shouldUseScanner
protected Store store
protected ScanQueryMatcher matcher
protected KeyValueHeap heap
protected boolean cacheBlocks
protected int countPerRow
protected int storeLimit
protected int storeOffset
protected boolean closing
protected final boolean isGet
protected final boolean explicitColumnQuery
protected final boolean useRowColBloom
protected boolean isParallelSeekEnabled
protected ExecutorService executor
protected final Scan scan
protected final NavigableSet<byte[]> columns
protected final long oldestUnexpiredTS
protected final int minVersions
public static final String STORESCANNER_PARALLEL_SEEK_ENABLE
protected static boolean lazySeekEnabledGlobally
protected KeyValue lastTop
protected ReentrantLock lock
protected StoreScanner(Store store, boolean cacheBlocks, Scan scan, NavigableSet<byte[]> columns, long ttl, int minVersions, long readPt)
public StoreScanner(Store store, ScanInfo scanInfo, Scan scan, NavigableSet<byte[]> columns, long readPt) throws IOException
store
- who we scanscan
- the speccolumns
- which columns we are scanningIOException
public StoreScanner(Store store, ScanInfo scanInfo, Scan scan, List<? extends KeyValueScanner> scanners, ScanType scanType, long smallestReadPoint, long earliestPutTs) throws IOException
Opens a scanner across specified StoreFiles.
store
- who we scanscan
- the specscanners
- ancillary scannerssmallestReadPoint
- the readPoint that we should use for tracking
versionsIOException
public StoreScanner(Store store, ScanInfo scanInfo, Scan scan, List<? extends KeyValueScanner> scanners, long smallestReadPoint, long earliestPutTs, byte[] dropDeletesFromRow, byte[] dropDeletesToRow) throws IOException
Opens a scanner across specified StoreFiles.
store
- who we scanscan
- the specscanners
- ancillary scannerssmallestReadPoint
- the readPoint that we should use for tracking versionsdropDeletesFromRow
- The inclusive left bound of the range; can be EMPTY_START_ROW.dropDeletesToRow
- The exclusive right bound of the range; can be EMPTY_END_ROW.IOException
protected List<KeyValueScanner> getScannersNoCompaction() throws IOException
IOException
protected void seekScanners(List<? extends KeyValueScanner> scanners, KeyValue seekKey, boolean isLazy, boolean isParallelSeek) throws IOException
scanners
- seekKey
- isLazy
- true if using lazy seekisParallelSeek
- true if using parallel seekIOException
protected void resetKVHeap(List<? extends KeyValueScanner> scanners, KeyValue.KVComparator comparator) throws IOException
IOException
protected List<KeyValueScanner> selectScannersFrom(List<? extends KeyValueScanner> allScanners)
public KeyValue peek()
KeyValueScanner
peek
in interface KeyValueScanner
public KeyValue next()
KeyValueScanner
next
in interface KeyValueScanner
public void close()
KeyValueScanner
close
in interface Closeable
close
in interface AutoCloseable
close
in interface InternalScanner
close
in interface KeyValueScanner
public boolean seek(KeyValue key) throws IOException
KeyValueScanner
seek
in interface KeyValueScanner
key
- seek valueIOException
public boolean next(List<Cell> outResult, int limit) throws IOException
next
in interface InternalScanner
outResult
- limit
- IOException
- epublic boolean next(List<Cell> outResult) throws IOException
InternalScanner
next
in interface InternalScanner
outResult
- return output arrayIOException
- epublic void updateReaders() throws IOException
ChangedReadersObserver
updateReaders
in interface ChangedReadersObserver
IOException
- eprotected boolean checkReseek() throws IOException
IOException
protected void resetScannerStack(KeyValue lastTopKey) throws IOException
IOException
protected void checkScanOrder(KeyValue prevKV, KeyValue kv, KeyValue.KVComparator comparator) throws IOException
prevKV
- kv
- comparator
- IOException
protected boolean seekToNextRow(KeyValue kv) throws IOException
IOException
protected boolean seekAsDirection(KeyValue kv) throws IOException
kv
- IOException
public boolean reseek(KeyValue kv) throws IOException
KeyValueScanner
reseek
in interface KeyValueScanner
kv
- seek value (should be non-null)IOException
public long getSequenceID()
KeyValueScanner
getSequenceID
in interface KeyValueScanner
public long getEstimatedNumberOfKvsScanned()
Copyright © 2014 The Apache Software Foundation. All rights reserved.