Class NoLimitScannerContext
java.lang.Object
org.apache.hadoop.hbase.regionserver.ScannerContext
org.apache.hadoop.hbase.regionserver.NoLimitScannerContext
This is a special
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.regionserver.ScannerContext
ScannerContext.Builder, ScannerContext.LimitScope, ScannerContext.NextState
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final ScannerContext
Use this instance whenever limits do not need to be enforced.Fields inherited from class org.apache.hadoop.hbase.regionserver.ScannerContext
keepProgress, limits, metrics, progress, scannerState, skippingRow
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(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
Clear away any progress that has been made so far.static final ScannerContext
Returns the static, immutable instance ofNoLimitScannerContext
to be used whenever limits should not be enforced(package private) void
setBatchProgress
(int batchProgress) (package private) void
setKeepProgress
(boolean keepProgress) (package private) void
setProgress
(int batchProgress, long sizeProgress, long heapSizeProgress) (package private) ScannerContext.NextState
Note that this is not a typical setter.(package private) void
(package private) void
setSizeProgress
(long sizeProgress, long heapSizeProgress) (package private) void
Methods inherited from class org.apache.hadoop.hbase.regionserver.ScannerContext
getBatchLimit, getBatchProgress, getBlockSizeProgress, getDataSizeLimit, getDataSizeProgress, getHeapSizeProgress, getKeepProgress, getLastPeekedCell, getMetrics, getSkippingRow, getTimeLimit, getTimeProgress, hasAnyLimit, hasBatchLimit, hasSizeLimit, hasTimeLimit, incrementBatchProgress, incrementBlockProgress, incrementSizeProgress, isTrackingMetrics, mayHaveMoreCellsInRow, newBuilder, newBuilder, returnImmediately, setLastPeekedCell, setProgress, setSkippingRow, setTimeProgress, toString, updateTimeProgress
-
Field Details
-
NO_LIMIT
Use this instance whenever limits do not need to be enforced.
-
-
Constructor Details
-
NoLimitScannerContext
public NoLimitScannerContext()
-
-
Method Details
-
getInstance
Returns the static, immutable instance ofNoLimitScannerContext
to be used whenever limits should not be enforced -
setKeepProgress
- Overrides:
setKeepProgress
in classScannerContext
-
setBatchProgress
- Overrides:
setBatchProgress
in classScannerContext
-
setSizeProgress
- Overrides:
setSizeProgress
in classScannerContext
-
setProgress
- Overrides:
setProgress
in classScannerContext
-
clearProgress
void clearProgress()Description copied from class:ScannerContext
Clear away any progress that has been made so far. All progress fields are reset to initial values. Only clears progress that should reset between rows.ScannerContext.getBlockSizeProgress()
is not reset because it increments for all blocks scanned whether the result is included or filtered.- Overrides:
clearProgress
in classScannerContext
-
setSizeLimitScope
- Overrides:
setSizeLimitScope
in classScannerContext
- Parameters:
scope
- The scope in which the size limit will be enforced
-
setTimeLimitScope
- Overrides:
setTimeLimitScope
in classScannerContext
- Parameters:
scope
- The scope in which the time limit will be enforced
-
setScannerState
Description copied from class:ScannerContext
Note that this is not a typical setter. This setter returns theScannerContext.NextState
that was passed in so that methods can be invoked against the new state. Furthermore, this pattern allows theNoLimitScannerContext
to cleanly override this setter and simply return the new state, thus preserving the immutability ofNoLimitScannerContext
- Overrides:
setScannerState
in classScannerContext
- Returns:
- The state that was passed in.
-
checkBatchLimit
- Overrides:
checkBatchLimit
in classScannerContext
- Parameters:
checkerScope
- The scope that the limit is being checked from- Returns:
- true when the limit is enforceable from the checker's scope and it has been reached
-
checkSizeLimit
- Overrides:
checkSizeLimit
in classScannerContext
- Parameters:
checkerScope
- The scope that the limit is being checked from- Returns:
- true when the limit is enforceable from the checker's scope and it has been reached
-
checkTimeLimit
- Overrides:
checkTimeLimit
in classScannerContext
- Parameters:
checkerScope
- The scope that the limit is being checked from. The time limit is always checked againstEnvironmentEdgeManager.currentTime
- Returns:
- true when the limit is enforceable from the checker's scope and it has been reached
-
checkAnyLimitReached
- Overrides:
checkAnyLimitReached
in classScannerContext
- Parameters:
checkerScope
- The scope that the limits are being checked from- Returns:
- true when some limit is enforceable from the checker's scope and it has been reached
-