Class ConstructSnapshot.StaticSnapshotControl
- All Implemented Interfaces:
ConstructSnapshot.SnapshotCompletedConsistently
,ConstructSnapshot.SnapshotConsistent
,ConstructSnapshot.SnapshotControl
,ConstructSnapshot.UsePreviousValues
- Enclosing class:
- ConstructSnapshot
public static final class ConstructSnapshot.StaticSnapshotControl extends Object implements ConstructSnapshot.SnapshotControl
ConstructSnapshot.SnapshotControl
for sources that cannot update.-
Field Summary
Fields Modifier and Type Field Description static ConstructSnapshot.SnapshotControl
INSTANCE
-
Method Summary
Modifier and Type Method Description boolean
snapshotConsistent(long currentClockValue, boolean usingPreviousValues)
Determine (from within a snapshot function) if the snapshot appears to still be consistent.Boolean
usePreviousValues(long beforeClockValue)
Determine if previous values should be used in table data access for the givenclock
value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.illumon.iris.db.v2.remote.ConstructSnapshot.SnapshotControl
snapshotCompletedConsistently
-
Field Details
-
Method Details
-
usePreviousValues
Description copied from interface:ConstructSnapshot.UsePreviousValues
Determine if previous values should be used in table data access for the given
clock
value.Expected to never request previous values during the idle phase of a cycle.
Must never request previous values for a source that has already been updated on the current cycle, unless it can be proven that that source was not instantiated on the current cycle.
Must be safe to call more than once, exactly once per snapshot attempt.
- Specified by:
usePreviousValues
in interfaceConstructSnapshot.UsePreviousValues
- Parameters:
beforeClockValue
- The current clock value before the snapshot function will be invoked- Returns:
- A
Boolean
with the following meaning:true
if previous values should be usedfalse
if they should notnull
if a clock discrepancy was detected and we must retry with a newbeforeClockValue
-
snapshotConsistent
public boolean snapshotConsistent(long currentClockValue, boolean usingPreviousValues)Description copied from interface:ConstructSnapshot.SnapshotConsistent
Determine (from within a snapshot function) if the snapshot appears to still be consistent.
This should be no more restrictive than the associated
ConstructSnapshot.SnapshotCompletedConsistently
.Can assume as a precondition that the clock step has not been observed to change since the last time the associated
ConstructSnapshot.UsePreviousValues.usePreviousValues(long)
was invoked, and that the clock state has not been observed to change if previous values were used. SeeConstructSnapshot.clockConsistent(long, long, boolean)
.- Specified by:
snapshotConsistent
in interfaceConstructSnapshot.SnapshotConsistent
- Parameters:
currentClockValue
- The current clock valueusingPreviousValues
- Whether the snapshot function is using previous values- Returns:
- True if we can no longer expect that the snapshot function's result will be consistent
-