@InterfaceAudience.LimitedPrivate(value="Coprocesssor") @InterfaceStability.Evolving public class NoLimitScannerContext extends ScannerContext
ScannerContext
subclass that is designed to be used globally when
limits should not be enforced during invocations of InternalScanner.next(java.util.List)
or InternalScanner.next(java.util.List)
.
Instances of NoLimitScannerContext
are immutable after construction. Any attempt to
change the limits or progress of a NoLimitScannerContext
will fail silently. The net
effect is that all limit checks will return false, thus indicating that a limit has not been
reached.
ScannerContext.Builder, ScannerContext.LimitScope, ScannerContext.NextState
Modifier and Type | Field and Description |
---|---|
private static ScannerContext |
NO_LIMIT
Use this instance whenever limits do not need to be enforced.
|
keepProgress, limits, metrics, progress, scannerState
Constructor and Description |
---|
NoLimitScannerContext() |
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
checkAnyLimitReached(ScannerContext.LimitScope checkerScope) |
(package private) boolean |
checkBatchLimit(ScannerContext.LimitScope checkerScope) |
(package private) boolean |
checkSizeLimit(ScannerContext.LimitScope checkerScope) |
(package private) boolean |
checkTimeLimit(ScannerContext.LimitScope checkerScope) |
(package private) void |
clearProgress()
Clear away any progress that has been made so far.
|
static ScannerContext |
getInstance() |
(package private) void |
setBatchProgress(int batchProgress) |
(package private) void |
setKeepProgress(boolean keepProgress) |
(package private) void |
setProgress(int batchProgress,
long sizeProgress,
long timeProgress) |
(package private) ScannerContext.NextState |
setScannerState(ScannerContext.NextState state)
Note that this is not a typical setter.
|
(package private) void |
setSizeLimitScope(ScannerContext.LimitScope scope) |
(package private) void |
setSizeProgress(long sizeProgress) |
(package private) void |
setTimeLimitScope(ScannerContext.LimitScope scope) |
(package private) void |
setTimeProgress(long timeProgress) |
(package private) void |
updateTimeProgress()
Update the time progress with
System.currentTimeMillis() |
getBatchLimit, getBatchProgress, getKeepProgress, getMetrics, getSizeLimit, getSizeProgress, getTimeLimit, getTimeProgress, hasAnyLimit, hasBatchLimit, hasSizeLimit, hasTimeLimit, incrementBatchProgress, incrementSizeProgress, isTrackingMetrics, midRowResultFormed, newBuilder, newBuilder, partialResultFormed, toString
private static final ScannerContext NO_LIMIT
public static final ScannerContext getInstance()
NoLimitScannerContext
to be used whenever
limits should not be enforcedvoid setKeepProgress(boolean keepProgress)
setKeepProgress
in class ScannerContext
void setBatchProgress(int batchProgress)
setBatchProgress
in class ScannerContext
void setSizeProgress(long sizeProgress)
setSizeProgress
in class ScannerContext
void setTimeProgress(long timeProgress)
setTimeProgress
in class ScannerContext
void updateTimeProgress()
ScannerContext
System.currentTimeMillis()
updateTimeProgress
in class ScannerContext
void setProgress(int batchProgress, long sizeProgress, long timeProgress)
setProgress
in class ScannerContext
void clearProgress()
ScannerContext
clearProgress
in class ScannerContext
void setSizeLimitScope(ScannerContext.LimitScope scope)
setSizeLimitScope
in class ScannerContext
scope
- The scope in which the size limit will be enforcedvoid setTimeLimitScope(ScannerContext.LimitScope scope)
setTimeLimitScope
in class ScannerContext
scope
- The scope in which the time limit will be enforcedScannerContext.NextState setScannerState(ScannerContext.NextState state)
ScannerContext
ScannerContext.NextState
that was
passed in so that methods can be invoked against the new state. Furthermore, this pattern
allows the NoLimitScannerContext
to cleanly override this setter and simply return the
new state, thus preserving the immutability of NoLimitScannerContext
setScannerState
in class ScannerContext
boolean checkBatchLimit(ScannerContext.LimitScope checkerScope)
checkBatchLimit
in class ScannerContext
checkerScope
- The scope that the limit is being checked fromboolean checkSizeLimit(ScannerContext.LimitScope checkerScope)
checkSizeLimit
in class ScannerContext
checkerScope
- The scope that the limit is being checked fromboolean checkTimeLimit(ScannerContext.LimitScope checkerScope)
checkTimeLimit
in class ScannerContext
checkerScope
- The scope that the limit is being checked from. The time limit is always
checked against System.currentTimeMillis()
boolean checkAnyLimitReached(ScannerContext.LimitScope checkerScope)
checkAnyLimitReached
in class ScannerContext
checkerScope
- The scope that the limits are being checked fromCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.