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
FieldsModifier and TypeFieldDescriptionprivate static final ScannerContextUse 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
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) booleancheckAnyLimitReached(ScannerContext.LimitScope checkerScope) (package private) booleancheckBatchLimit(ScannerContext.LimitScope checkerScope) (package private) booleancheckSizeLimit(ScannerContext.LimitScope checkerScope) (package private) booleancheckTimeLimit(ScannerContext.LimitScope checkerScope) (package private) voidClear away any progress that has been made so far.static final ScannerContextReturns the static, immutable instance ofNoLimitScannerContextto be used whenever limits should not be enforced(package private) voidsetBatchProgress(int batchProgress) (package private) voidsetKeepProgress(boolean keepProgress) (package private) voidsetProgress(int batchProgress, long sizeProgress, long heapSizeProgress) (package private) ScannerContext.NextStateNote that this is not a typical setter.(package private) void(package private) voidsetSizeProgress(long sizeProgress, long heapSizeProgress) (package private) voidMethods 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 ofNoLimitScannerContextto be used whenever limits should not be enforced -
setKeepProgress
- Overrides:
setKeepProgressin classScannerContext
-
setBatchProgress
- Overrides:
setBatchProgressin classScannerContext
-
setSizeProgress
- Overrides:
setSizeProgressin classScannerContext
-
setProgress
- Overrides:
setProgressin classScannerContext
-
clearProgress
void clearProgress()Description copied from class:ScannerContextClear 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:
clearProgressin classScannerContext
-
setSizeLimitScope
- Overrides:
setSizeLimitScopein classScannerContext- Parameters:
scope- The scope in which the size limit will be enforced
-
setTimeLimitScope
- Overrides:
setTimeLimitScopein classScannerContext- Parameters:
scope- The scope in which the time limit will be enforced
-
setScannerState
Description copied from class:ScannerContextNote that this is not a typical setter. This setter returns theScannerContext.NextStatethat was passed in so that methods can be invoked against the new state. Furthermore, this pattern allows theNoLimitScannerContextto cleanly override this setter and simply return the new state, thus preserving the immutability ofNoLimitScannerContext- Overrides:
setScannerStatein classScannerContext- Returns:
- The state that was passed in.
-
checkBatchLimit
- Overrides:
checkBatchLimitin 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:
checkSizeLimitin 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:
checkTimeLimitin 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:
checkAnyLimitReachedin 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
-