for a single row.
Constructor Summary |
protected |
StoreScanner(Store store,
boolean cacheBlocks,
Scan scan,
NavigableSet<byte[]> columns,
long ttl,
int minVersions)
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)
Opens a scanner across memstore, snapshot, and all StoreFiles. |
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
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
StoreScanner
protected StoreScanner(Store store,
boolean cacheBlocks,
Scan scan,
NavigableSet<byte[]> columns,
long ttl,
int minVersions)
- An internal constructor.
StoreScanner
public StoreScanner(Store store,
ScanInfo scanInfo,
Scan scan,
NavigableSet<byte[]> columns)
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
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<KeyValue> 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<KeyValue> 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
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).
Copyright © 2013 The Apache Software Foundation. All Rights Reserved.