Class StepUpdater

java.lang.Object
io.deephaven.engine.table.impl.util.StepUpdater

public class StepUpdater extends Object
Tool for maintaining recorded clock steps.
  • Constructor Details

    • StepUpdater

      public StepUpdater()
  • Method Details

    • checkForOlderStep

      public static void checkForOlderStep(long requestedStep, long recordedStep)
      Validated that requestedStep is greater than or equal to recordedStep.
      Parameters:
      requestedStep - The requested step, e.g. as an argument to Dependency.satisfied
      recordedStep - The highest recorded step
      Throws:
      ClockInconsistencyException - if requestedStep < recordedStep
    • tryUpdateRecordedStep

      public static <T> void tryUpdateRecordedStep(@NotNull @NotNull AtomicLongFieldUpdater<T> recordedStepUpdater, @NotNull T instance, long step)
      Update a recorded step field to be at least step.
      Type Parameters:
      T - The type of instance expected by recordedStepUpdater
      Parameters:
      recordedStepUpdater - An updater for the recorded step field
      instance - The instance to update
      step - The target step value to record
      Throws:
      ClockInconsistencyException - if step < recordedStepUpdater.get(instance)
    • forceUpdateRecordedStep

      public static <T> void forceUpdateRecordedStep(@NotNull @NotNull AtomicLongFieldUpdater<T> recordedStepUpdater, @NotNull T instance, long step)
      Update a recorded step field to be exactly step. Validate that the previous recorded step was less than step.
      Type Parameters:
      T - The type of instance expected by recordedStepUpdater
      Parameters:
      recordedStepUpdater - An updater for the recorded step field
      instance - The instance to update
      step - The target step value to record