Class ConstructSnapshot.StaticSnapshotControl
- All Implemented Interfaces:
ConstructSnapshot.SnapshotCompletedConsistently,ConstructSnapshot.SnapshotConsistent,ConstructSnapshot.SnapshotControl,ConstructSnapshot.UsePreviousValues
- Enclosing class:
- ConstructSnapshot
ConstructSnapshot.SnapshotControl for sources that cannot update.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleansnapshotConsistent(long currentClockValue, boolean usingPreviousValues) Determine (from within a snapshot function) if the snapshot appears to still be consistent.usePreviousValues(long beforeClockValue) Determine if previous values should be used in table data access for the givenclockvalue.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.illumon.iris.db.v2.remote.ConstructSnapshot.SnapshotControl
snapshotCompletedConsistently
-
Field Details
-
INSTANCE
-
-
Method Details
-
usePreviousValues
Description copied from interface:ConstructSnapshot.UsePreviousValuesDetermine if previous values should be used in table data access for the given
clockvalue.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:
usePreviousValuesin interfaceConstructSnapshot.UsePreviousValues- Parameters:
beforeClockValue- The current clock value before the snapshot function will be invoked- Returns:
- A
Booleanwith the following meaning:trueif previous values should be usedfalseif they should notnullif 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.SnapshotConsistentDetermine (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:
snapshotConsistentin 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
-