Class StepUpdater
java.lang.Object
io.deephaven.engine.table.impl.util.StepUpdater
Tool for maintaining recorded clock steps.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckForOlderStep(long requestedStep, long recordedStep) Validated thatrequestedStepis greater than or equal torecordedStep.static <T> voidforceUpdateRecordedStep(@NotNull AtomicLongFieldUpdater<T> recordedStepUpdater, T instance, long step) Update a recorded step field to be exactlystep.static <T> voidtryUpdateRecordedStep(@NotNull AtomicLongFieldUpdater<T> recordedStepUpdater, T instance, long step) Update a recorded step field to be at leaststep.
-
Constructor Details
-
StepUpdater
public StepUpdater()
-
-
Method Details
-
checkForOlderStep
public static void checkForOlderStep(long requestedStep, long recordedStep) Validated thatrequestedStepis greater than or equal torecordedStep.- Parameters:
requestedStep- The requested step, e.g. as an argument toDependency.satisfiedrecordedStep- The highest recorded step- Throws:
ClockInconsistencyException- ifrequestedStep < 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 leaststep.- Type Parameters:
T- The type ofinstanceexpected byrecordedStepUpdater- Parameters:
recordedStepUpdater- An updater for the recorded step fieldinstance- The instance to updatestep- The target step value to record- Throws:
ClockInconsistencyException- ifstep < 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 exactlystep. Validate that the previous recorded step was less thanstep.- Type Parameters:
T- The type ofinstanceexpected byrecordedStepUpdater- Parameters:
recordedStepUpdater- An updater for the recorded step fieldinstance- The instance to updatestep- The target step value to record
-