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>>keyedStateCheckpointClosingFutureprotected RunnableFuture<SnapshotResult<OperatorStateHandle>>operatorStateCheckpointClosingFuture
-
Constructor Summary
Constructors Constructor Description StateSnapshotContextSynchronousImpl(long checkpointId, long checkpointTimestamp)StateSnapshotContextSynchronousImpl(long checkpointId, long checkpointTimestamp, CheckpointStreamFactory streamFactory, KeyGroupRange keyGroupRange, org.apache.flink.core.fs.CloseableRegistry closableRegistry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseExceptionally()longgetCheckpointId()Returns the ID of the checkpoint for which the snapshot is taken.longgetCheckpointTimestamp()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()KeyedStateCheckpointOutputStreamgetRawKeyedOperatorStateOutput()Returns an output stream for keyed stateOperatorStateCheckpointOutputStreamgetRawOperatorStateOutput()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, org.apache.flink.core.fs.CloseableRegistry closableRegistry)
-
-
Method Detail
-
getCheckpointId
public long getCheckpointId()
Description copied from interface:ManagedSnapshotContextReturns 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_Ameans that checkpoint B subsumes checkpoint A, i.e., checkpoint B contains a later state than checkpoint A.- Specified by:
getCheckpointIdin interfaceManagedSnapshotContext
-
getCheckpointTimestamp
public long getCheckpointTimestamp()
Description copied from interface:ManagedSnapshotContextReturns timestamp (wall clock time) when the master node triggered the checkpoint for which the state snapshot is taken.- Specified by:
getCheckpointTimestampin interfaceManagedSnapshotContext
-
getRawKeyedOperatorStateOutput
public KeyedStateCheckpointOutputStream getRawKeyedOperatorStateOutput() throws Exception
Description copied from interface:StateSnapshotContextReturns an output stream for keyed state- Specified by:
getRawKeyedOperatorStateOutputin interfaceStateSnapshotContext- Throws:
Exception
-
getRawOperatorStateOutput
public OperatorStateCheckpointOutputStream getRawOperatorStateOutput() throws Exception
Description copied from interface:StateSnapshotContextReturns an output stream for operator state- Specified by:
getRawOperatorStateOutputin 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
-
-