Interface ConstructSnapshot.SnapshotCompletedConsistently

All Known Subinterfaces:
ConstructSnapshot.SnapshotControl
All Known Implementing Classes:
ConstructSnapshot.StaticSnapshotControl, OperationSnapshotControl, OperationSnapshotControlEx
Enclosing class:
ConstructSnapshot
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface ConstructSnapshot.SnapshotCompletedConsistently
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    snapshotCompletedConsistently(long afterClockValue, boolean usedPreviousValues)
    Determine if a snapshot was consistent according to the clock cycle.
  • Method Details

    • snapshotCompletedConsistently

      boolean snapshotCompletedConsistently(long afterClockValue, boolean usedPreviousValues)

      Determine if a snapshot was consistent according to the clock cycle. Intended to be paired with a ConstructSnapshot.UsePreviousValues function.

      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. See ConstructSnapshot.clockConsistent(long, long, boolean).

      Will be called at most once per snapshot attempt. Will be called for all possibly-successful snapshot attempts. May be called after unsuccessful concurrent snapshot attempts.

      Parameters:
      afterClockValue - The current clock value after the snapshot function was invoked
      usedPreviousValues - If previous values were used
      Returns:
      Whether the snapshot is provably consistent
      Throws:
      RuntimeException - If the snapshot was consistent but the snapshot function failed to satisfy this function's expectations; this will be treated as a failure of the snapshot function