for a single row.
Constructor Summary |
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. |
Method Summary |
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()
|
byte[] |
getNextIndexedKey()
|
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
store
protected Store store
matcher
protected ScanQueryMatcher matcher
heap
protected KeyValueHeap heap
cacheBlocks
protected boolean cacheBlocks
countPerRow
protected int countPerRow
storeLimit
protected int storeLimit
storeOffset
protected int storeOffset
closing
protected boolean closing
isGet
protected final boolean isGet
explicitColumnQuery
protected final boolean explicitColumnQuery
useRowColBloom
protected final boolean useRowColBloom
isParallelSeekEnabled
protected boolean isParallelSeekEnabled
- A flag that enables StoreFileScanner parallel-seeking
executor
protected ExecutorService executor
scan
protected final Scan scan
columns
protected final NavigableSet<byte[]> columns
oldestUnexpiredTS
protected final long oldestUnexpiredTS
now
protected final long now
minVersions
protected final int minVersions
STORESCANNER_PARALLEL_SEEK_ENABLE
public static final String STORESCANNER_PARALLEL_SEEK_ENABLE
- See Also:
- Constant Field Values
lazySeekEnabledGlobally
protected static boolean lazySeekEnabledGlobally
- Used during unit testing to ensure that lazy seek does save seek ops
lastTop
protected KeyValue lastTop
lock
protected ReentrantLock lock
StoreScanner
protected StoreScanner(Store store,
boolean cacheBlocks,
Scan scan,
NavigableSet<byte[]> columns,
long ttl,
int minVersions,
long readPt)
- An internal constructor.
StoreScanner
public StoreScanner(Store store,
ScanInfo scanInfo,
Scan scan,
NavigableSet<byte[]> columns,
long readPt)
throws IOException
- Opens a scanner across memstore, snapshot, and all StoreFiles. Assumes we
are not in a compaction.
- Parameters:
store
- who we scanscan
- the speccolumns
- which columns we are scanning
- Throws:
IOException
StoreScanner
public StoreScanner(Store store,
ScanInfo scanInfo,
Scan scan,
List<? extends KeyValueScanner> scanners,
ScanType scanType,
long smallestReadPoint,
long earliestPutTs)
throws IOException
- Used for compactions.
Opens a scanner across specified StoreFiles.
- Parameters:
store
- who we scanscan
- the specscanners
- ancillary scannerssmallestReadPoint
- the readPoint that we should use for tracking
versions
- Throws:
IOException
StoreScanner
public StoreScanner(Store store,
ScanInfo scanInfo,
Scan scan,
List<? extends KeyValueScanner> scanners,
long smallestReadPoint,
long earliestPutTs,
byte[] dropDeletesFromRow,
byte[] dropDeletesToRow)
throws IOException
- Used for compactions that drop deletes from a limited range of rows.
Opens a scanner across specified StoreFiles.
- Parameters:
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.
- Throws:
IOException
getScannersNoCompaction
protected List<KeyValueScanner> getScannersNoCompaction()
throws IOException
- Get a filtered list of scanners. Assumes we are not in a compaction.
- Returns:
- list of scanners to seek
- Throws:
IOException
seekScanners
protected void seekScanners(List<? extends KeyValueScanner> scanners,
KeyValue seekKey,
boolean isLazy,
boolean isParallelSeek)
throws IOException
- Seek the specified scanners with the given key
- Parameters:
scanners
- seekKey
- isLazy
- true if using lazy seekisParallelSeek
- true if using parallel seek
- Throws:
IOException
resetKVHeap
protected void resetKVHeap(List<? extends KeyValueScanner> scanners,
KeyValue.KVComparator comparator)
throws IOException
- Throws:
IOException
selectScannersFrom
protected List<KeyValueScanner> selectScannersFrom(List<? extends KeyValueScanner> allScanners)
- Filters the given list of scanners using Bloom filter, time range, and
TTL.
peek
public KeyValue peek()
- Description copied from interface:
KeyValueScanner
- Look at the next KeyValue in this scanner, but do not iterate scanner.
- Specified by:
peek
in interface KeyValueScanner
- Returns:
- the next KeyValue
next
public KeyValue next()
- Description copied from interface:
KeyValueScanner
- Return the next KeyValue in this scanner, iterating the scanner
- Specified by:
next
in interface KeyValueScanner
- Returns:
- the next KeyValue
close
public void close()
- Description copied from interface:
KeyValueScanner
- Close the KeyValue scanner.
- Specified by:
close
in interface Closeable
- Specified by:
close
in interface InternalScanner
- Specified by:
close
in interface KeyValueScanner
seek
public boolean seek(KeyValue key)
throws IOException
- Description copied from interface:
KeyValueScanner
- Seek the scanner at or after the specified KeyValue.
- Specified by:
seek
in interface KeyValueScanner
- Parameters:
key
- seek value
- Returns:
- true if scanner has values left, false if end of scanner
- Throws:
IOException
next
public boolean next(List<Cell> outResult,
int limit)
throws IOException
- Get the next row of values from this Store.
- Specified by:
next
in interface InternalScanner
- Parameters:
outResult
- limit
-
- Returns:
- true if there are more rows, false if scanner is done
- Throws:
IOException
- e
next
public boolean next(List<Cell> outResult)
throws IOException
- Description copied from interface:
InternalScanner
- Grab the next row's worth of values.
- Specified by:
next
in interface InternalScanner
- Parameters:
outResult
- return output array
- Returns:
- true if more rows exist after this one, false if scanner is done
- Throws:
IOException
- e
updateReaders
public void updateReaders()
throws IOException
- Description copied from interface:
ChangedReadersObserver
- Notify observers.
- Specified by:
updateReaders
in interface ChangedReadersObserver
- Throws:
IOException
- e
checkReseek
protected boolean checkReseek()
throws IOException
- Returns:
- true if top of heap has changed (and KeyValueHeap has to try the
next KV)
- Throws:
IOException
resetScannerStack
protected void resetScannerStack(KeyValue lastTopKey)
throws IOException
- Throws:
IOException
checkScanOrder
protected void checkScanOrder(KeyValue prevKV,
KeyValue kv,
KeyValue.KVComparator comparator)
throws IOException
- Check whether scan as expected order
- Parameters:
prevKV
- kv
- comparator
-
- Throws:
IOException
seekToNextRow
protected boolean seekToNextRow(KeyValue kv)
throws IOException
- Throws:
IOException
seekAsDirection
protected boolean seekAsDirection(KeyValue kv)
throws IOException
- Do a reseek in a normal StoreScanner(scan forward)
- Parameters:
kv
-
- Returns:
- true if scanner has values left, false if end of scanner
- Throws:
IOException
reseek
public boolean reseek(KeyValue kv)
throws IOException
- 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 interface KeyValueScanner
- Parameters:
kv
- seek value (should be non-null)
- Returns:
- true if scanner has values left, false if end of scanner
- Throws:
IOException
getSequenceID
public long getSequenceID()
- Description copied from interface:
KeyValueScanner
- Get the sequence id associated with this KeyValueScanner. This is required
for comparing multiple files to find out which one has the latest data.
The default implementation for this would be to return 0. A file having
lower sequence id will be considered to be the older one.
- Specified by:
getSequenceID
in interface KeyValueScanner
getEstimatedNumberOfKvsScanned
public long getEstimatedNumberOfKvsScanned()
- Returns:
- The estimated number of KVs seen by this scanner (includes some skipped KVs).
getNextIndexedKey
public byte[] getNextIndexedKey()
- Specified by:
getNextIndexedKey
in interface KeyValueScanner
- Overrides:
getNextIndexedKey
in class NonLazyKeyValueScanner
- Returns:
- the next key in the index (the key to seek to the next block)
if known, or null otherwise
Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.