Class StepUpdater
java.lang.Object
io.deephaven.engine.table.impl.util.StepUpdater
Tool for maintaining recorded clock steps.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkForOlderStep
(long requestedStep, long recordedStep) Validated thatrequestedStep
is greater than or equal torecordedStep
.static <T> void
forceUpdateRecordedStep
(@NotNull AtomicLongFieldUpdater<T> recordedStepUpdater, T instance, long step) Update a recorded step field to be exactlystep
.static <T> void
tryUpdateRecordedStep
(@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 thatrequestedStep
is greater than or equal torecordedStep
.- Parameters:
requestedStep
- The requested step, e.g. as an argument toDependency.satisfied
recordedStep
- 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 ofinstance
expected 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 ofinstance
expected byrecordedStepUpdater
- Parameters:
recordedStepUpdater
- An updater for the recorded step fieldinstance
- The instance to updatestep
- The target step value to record
-