@InterfaceAudience.Private public class RegionScannerImpl extends Object implements RegionScanner, Shipper, RpcCallback
| Modifier and Type | Field and Description |
|---|---|
protected CellComparator |
comparator |
protected boolean |
includeStopRow |
protected Cell |
joinedContinuationRow
If the joined heap data gathering is interrupted due to scan limits, this will contain the row
for which we are populating the values.
|
protected HRegion |
region |
protected byte[] |
stopRow |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the scanner and releases any resources it has allocated
|
int |
getBatch() |
ScannerContext |
getContext() |
long |
getMaxResultSize() |
long |
getMvccReadPoint()
Returns The Scanner's MVCC readPt see
MultiVersionConcurrencyControl |
String |
getOperationId() |
RegionInfo |
getRegionInfo()
Returns The RegionInfo for this scanner.
|
protected void |
initializeKVHeap(List<KeyValueScanner> scanners,
List<KeyValueScanner> joinedScanners,
HRegion region) |
boolean |
isFilterDone()
Returns True if a filter rules the scanner is over, done.
|
boolean |
next(List<Cell> outResults)
Grab the next row's worth of values.
|
boolean |
next(List<Cell> outResults,
ScannerContext scannerContext)
Grab the next row's worth of values.
|
boolean |
nextRaw(List<Cell> outResults)
Grab the next row's worth of values.
|
boolean |
nextRaw(List<Cell> outResults,
ScannerContext scannerContext)
Grab the next row's worth of values.
|
protected boolean |
nextRow(ScannerContext scannerContext,
Cell curRowCell) |
boolean |
reseek(byte[] row)
Do a reseek to the required row.
|
protected void |
resetFilters()
Reset both the filter and the old filter.
|
void |
run()
Called at the end of an Rpc Call
RpcCallContext |
void |
shipped()
Called after a batch of rows scanned and set to be returned to client.
|
protected boolean |
shouldStop(Cell currentRowCell) |
protected Cell joinedContinuationRow
protected final byte[] stopRow
protected final boolean includeStopRow
protected final HRegion region
protected final CellComparator comparator
public RegionInfo getRegionInfo()
RegionScannergetRegionInfo in interface RegionScannerpublic ScannerContext getContext()
protected void initializeKVHeap(List<KeyValueScanner> scanners, List<KeyValueScanner> joinedScanners, HRegion region) throws IOException
IOExceptionpublic long getMaxResultSize()
getMaxResultSize in interface RegionScannerScan.setMaxResultSize(long)public long getMvccReadPoint()
RegionScannerMultiVersionConcurrencyControlgetMvccReadPoint in interface RegionScannerpublic int getBatch()
getBatch in interface RegionScannerScan.setBatch(int)public String getOperationId()
getOperationId in interface RegionScannerOperationWithAttributes.ID_ATRIBUTE value, or null if
not set.protected final void resetFilters()
throws IOException
IOException - in case a filter raises an I/O exception.public boolean next(List<Cell> outResults) throws IOException
InternalScannernext in interface InternalScanneroutResults - return output arrayIOException - epublic boolean next(List<Cell> outResults, ScannerContext scannerContext) throws IOException
InternalScannernext in interface InternalScanneroutResults - return output arrayIOException - epublic boolean nextRaw(List<Cell> outResults) throws IOException
RegionScannerRegionScanner.nextRaw(List, ScannerContext)nextRaw in interface RegionScanneroutResults - return output arrayIOException - epublic boolean nextRaw(List<Cell> outResults, ScannerContext scannerContext) throws IOException
RegionScannerScannerContext is used to enforce and track
any limits associated with this call. Any progress that exists in the ScannerContext
prior to calling this method will be LOST if ScannerContext.getKeepProgress() is false.
Upon returning from this method, the ScannerContext will contain information about the
progress made towards the limits. This is a special internal method to be called from
coprocessor hooks to avoid expensive setup. Caller must set the thread's readpoint, start and
close a region operation, an synchronize on the scanner object. Example:
HRegion region = ...;
RegionScanner scanner = ...
MultiVersionConcurrencyControl.setThreadReadPoint(scanner.getMvccReadPoint());
region.startRegionOperation();
try {
synchronized(scanner) {
...
boolean moreRows = scanner.nextRaw(values);
...
}
} finally {
region.closeRegionOperation();
}
nextRaw in interface RegionScanneroutResults - return output arrayscannerContext - The ScannerContext instance encapsulating all limits that should
be tracked during calls to this method. The progress towards these limits
can be tracked within this instance.IOException - epublic boolean isFilterDone()
throws IOException
isFilterDone in interface RegionScannerIOException - in case of I/O failure on a filter.protected boolean nextRow(ScannerContext scannerContext, Cell curRowCell) throws IOException
IOExceptionprotected boolean shouldStop(Cell currentRowCell)
public void close()
InternalScannerclose in interface Closeableclose in interface AutoCloseableclose in interface InternalScannerpublic boolean reseek(byte[] row)
throws IOException
RegionScannerreseek in interface RegionScannerIOExceptionpublic void shipped()
throws IOException
Shippershipped in interface ShipperIOExceptionpublic void run()
throws IOException
RpcCallbackRpcCallContextrun in interface RpcCallbackIOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.