@InterfaceAudience.LimitedPrivate(value="Coprocesssor") @InterfaceStability.Evolving public class ScannerContext extends Object
InternalScanner.next(java.util.List)
and
InternalScanner.next(java.util.List)
.
A ScannerContext instance should be updated periodically throughout execution whenever progress towards a limit has been made. Each limit can be checked via the appropriate checkLimit method.
Once a limit has been reached, the scan will stop. The invoker of
InternalScanner.next(java.util.List)
or InternalScanner.next(java.util.List)
can
use the appropriate check*Limit methods to see exactly which limits have been reached.
Alternatively, checkAnyLimitReached(LimitScope)
is provided to see if ANY limit was
reached
NoLimitScannerContext.NO_LIMIT
is an immutable static definition that can be used
whenever a ScannerContext
is needed but limits do not need to be enforced.
NOTE: It is important that this class only ever expose setter methods that can be safely skipped
when limits should be NOT enforced. This is because of the necessary immutability of the class
NoLimitScannerContext
. If a setter cannot be safely skipped, the immutable nature of
NoLimitScannerContext
will lead to incorrect behavior.
Modifier and Type | Class and Description |
---|---|
static class |
ScannerContext.Builder |
static class |
ScannerContext.LimitScope
The various scopes where a limit can be enforced.
|
static class |
ScannerContext.NextState
The possible states a scanner may be in following a call to
InternalScanner.next(List) |
Modifier and Type | Method and Description |
---|---|
ServerSideScanMetrics |
getMetrics()
Get the metrics instance.
|
boolean |
isTrackingMetrics() |
static ScannerContext.Builder |
newBuilder() |
static ScannerContext.Builder |
newBuilder(boolean keepProgress) |
String |
toString() |
public boolean isTrackingMetrics()
public ServerSideScanMetrics getMetrics()
isTrackingMetrics()
has been made to confirm that metrics are indeed being tracked.ServerSideScanMetrics
instance that is tracking metrics for this scanpublic static ScannerContext.Builder newBuilder()
public static ScannerContext.Builder newBuilder(boolean keepProgress)
Copyright © 2007–2019 Cloudera. All rights reserved.