Package org.apache.flink.runtime.state
Class StateSnapshotContextSynchronousImpl
- java.lang.Object
-
- org.apache.flink.runtime.state.StateSnapshotContextSynchronousImpl
-
- All Implemented Interfaces:
FunctionSnapshotContext
,ManagedSnapshotContext
,StateSnapshotContext
public class StateSnapshotContextSynchronousImpl extends Object implements StateSnapshotContext
This class is a default implementation for StateSnapshotContext.
-
-
Field Summary
Fields Modifier and Type Field Description protected RunnableFuture<SnapshotResult<KeyedStateHandle>>
keyedStateCheckpointClosingFuture
protected RunnableFuture<SnapshotResult<OperatorStateHandle>>
operatorStateCheckpointClosingFuture
-
Constructor Summary
Constructors Constructor Description StateSnapshotContextSynchronousImpl(long checkpointId, long checkpointTimestamp)
StateSnapshotContextSynchronousImpl(long checkpointId, long checkpointTimestamp, CheckpointStreamFactory streamFactory, KeyGroupRange keyGroupRange, CloseableRegistry closableRegistry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeExceptionally()
long
getCheckpointId()
Returns the ID of the checkpoint for which the snapshot is taken.long
getCheckpointTimestamp()
Returns timestamp (wall clock time) when the master node triggered the checkpoint for which the state snapshot is taken.RunnableFuture<SnapshotResult<KeyedStateHandle>>
getKeyedStateStreamFuture()
RunnableFuture<SnapshotResult<OperatorStateHandle>>
getOperatorStateStreamFuture()
KeyedStateCheckpointOutputStream
getRawKeyedOperatorStateOutput()
Returns an output stream for keyed stateOperatorStateCheckpointOutputStream
getRawOperatorStateOutput()
Returns an output stream for operator state
-
-
-
Field Detail
-
keyedStateCheckpointClosingFuture
protected RunnableFuture<SnapshotResult<KeyedStateHandle>> keyedStateCheckpointClosingFuture
-
operatorStateCheckpointClosingFuture
protected RunnableFuture<SnapshotResult<OperatorStateHandle>> operatorStateCheckpointClosingFuture
-
-
Constructor Detail
-
StateSnapshotContextSynchronousImpl
@VisibleForTesting public StateSnapshotContextSynchronousImpl(long checkpointId, long checkpointTimestamp)
-
StateSnapshotContextSynchronousImpl
public StateSnapshotContextSynchronousImpl(long checkpointId, long checkpointTimestamp, CheckpointStreamFactory streamFactory, KeyGroupRange keyGroupRange, CloseableRegistry closableRegistry)
-
-
Method Detail
-
getCheckpointId
public long getCheckpointId()
Description copied from interface:ManagedSnapshotContext
Returns the ID of the checkpoint for which the snapshot is taken.The checkpoint ID is guaranteed to be strictly monotonously increasing across checkpoints. For two completed checkpoints A and B,
ID_B > ID_A
means that checkpoint B subsumes checkpoint A, i.e., checkpoint B contains a later state than checkpoint A.- Specified by:
getCheckpointId
in interfaceManagedSnapshotContext
-
getCheckpointTimestamp
public long getCheckpointTimestamp()
Description copied from interface:ManagedSnapshotContext
Returns timestamp (wall clock time) when the master node triggered the checkpoint for which the state snapshot is taken.- Specified by:
getCheckpointTimestamp
in interfaceManagedSnapshotContext
-
getRawKeyedOperatorStateOutput
public KeyedStateCheckpointOutputStream getRawKeyedOperatorStateOutput() throws Exception
Description copied from interface:StateSnapshotContext
Returns an output stream for keyed state- Specified by:
getRawKeyedOperatorStateOutput
in interfaceStateSnapshotContext
- Throws:
Exception
-
getRawOperatorStateOutput
public OperatorStateCheckpointOutputStream getRawOperatorStateOutput() throws Exception
Description copied from interface:StateSnapshotContext
Returns an output stream for operator state- Specified by:
getRawOperatorStateOutput
in interfaceStateSnapshotContext
- Throws:
Exception
-
getKeyedStateStreamFuture
@Nonnull public RunnableFuture<SnapshotResult<KeyedStateHandle>> getKeyedStateStreamFuture() throws IOException
- Throws:
IOException
-
getOperatorStateStreamFuture
@Nonnull public RunnableFuture<SnapshotResult<OperatorStateHandle>> getOperatorStateStreamFuture() throws IOException
- Throws:
IOException
-
closeExceptionally
public void closeExceptionally() throws IOException
- Throws:
IOException
-
-