Package com.apple.foundationdb.record
Interface RecordScanLimiter
-
@API(INTERNAL) public interface RecordScanLimiter
Track number of records scanned up to some limit, after which record scans should not be allowed.- See Also:
ExecuteState.getRecordScanLimiter()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getLimit()
Get the record scan limit.int
getRecordsScanned()
Returns the number of records that have been scanned thus far.boolean
isEnforcing()
Return whether or not this limiter has an actual limit.RecordScanLimiter
reset()
Create a newRecordScanLimiter
with this limiter's original limit, ignoring any calls totryRecordScan()
.boolean
tryRecordScan()
Atomically decrement the counter and return false if falls below 0.
-
-
-
Method Detail
-
reset
@Nonnull RecordScanLimiter reset()
Create a newRecordScanLimiter
with this limiter's original limit, ignoring any calls totryRecordScan()
.- Returns:
- a new limiter with the same original scan limit as this limiter
-
isEnforcing
boolean isEnforcing()
Return whether or not this limiter has an actual limit.- Returns:
true
if the limiter is enforcing a limit.
-
tryRecordScan
boolean tryRecordScan()
Atomically decrement the counter and return false if falls below 0.- Returns:
true
if the remaining count is at least 0, andfalse
if it is less than 0
-
getLimit
int getLimit()
Get the record scan limit. In particular, this will return the target number of records that this limiter is being used to enforce.- Returns:
- the record scan limit being enforced
-
getRecordsScanned
int getRecordsScanned()
Returns the number of records that have been scanned thus far.- Returns:
- the number of records that have been scanned
-
-