Interface LogicalClock

All Known Implementing Classes:
LogicalClockImpl

public interface LogicalClock
A logical update clock interface that has two states, Updating and Idle.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    The state component of a logical timestamp.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    The "null" value, which encodes {step=-1, state=Idle}.
    static final long
     
    static final long
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the current clock state.
    default long
    Get the current Step of the clock.
    long
    Get the current value of the clock.
    getState(long value)
    Get the LogicalClock.State of the LogicalClock for a particular clock value.
    static long
    getStep(long value)
    Get the clock step for the input clock value.
  • Field Details

    • NULL_CLOCK_VALUE

      static final long NULL_CLOCK_VALUE
      The "null" value, which encodes {step=-1, state=Idle}. Used as a marker when no clock value is appropriate, e.g. for snapshots of static data.
      See Also:
    • STEP_SHIFT

      static final long STEP_SHIFT
      See Also:
    • STATE_MASK

      static final long STATE_MASK
      See Also:
  • Method Details

    • getStep

      static long getStep(long value)
      Get the clock step for the input clock value. The step increments one time for each complete start - end cycle.
      Parameters:
      value - The clock value to get the step for
      Returns:
      The clock step associated with value
    • getState

      static LogicalClock.State getState(long value)
      Get the LogicalClock.State of the LogicalClock for a particular clock value.
      Parameters:
      value - The clock value
      Returns:
      The clock state associated with the input value
    • currentValue

      long currentValue()
      Get the current value of the clock.
    • currentStep

      @FinalDefault default long currentStep()
      Get the current Step of the clock.
      See Also:
    • currentState

      @FinalDefault default LogicalClock.State currentState()
      Get the current clock state.
      See Also: