T
- The type of the operator state.@PublicEvolving public interface Checkpointed<T extends Serializable>
This interface marks a function as synchronously checkpointed. While the
state is written, the function is not called, so the function needs not return a
copy of its state, but may return a reference to its state. Functions that can
continue to work and mutate the state, even while the state snapshot is being accessed,
can implement the CheckpointedAsynchronously
interface.
Modifier and Type | Method and Description |
---|---|
void |
restoreState(T state)
Restores the state of the function or operator to that of a previous checkpoint.
|
T |
snapshotState(long checkpointId,
long checkpointTimestamp)
Gets the current state of the function of operator.
|
T snapshotState(long checkpointId, long checkpointTimestamp) throws Exception
checkpointId
- The ID of the checkpoint.checkpointTimestamp
- The timestamp of the checkpoint, as derived by
System.currentTimeMillis() on the JobManager.Exception
- Thrown if the creation of the state object failed. This causes the
checkpoint to fail. The system may decide to fail the operation (and trigger
recovery), or to discard this checkpoint attempt and to continue running
and to try again with the next checkpoint attempt.void restoreState(T state) throws Exception
state
- The state to be restored.Exception
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.