Interface CompositeStateHandle
-
- All Superinterfaces:
Serializable
,StateObject
- All Known Subinterfaces:
ChangelogStateBackendHandle
,ChangelogStateHandle
,CheckpointBoundKeyedStateHandle
,IncrementalKeyedStateHandle
,KeyedStateHandle
,SavepointKeyedStateHandle
- All Known Implementing Classes:
AbstractIncrementalStateHandle
,ChangelogStateBackendHandle.ChangelogStateBackendHandleImpl
,ChangelogStateBackendLocalHandle
,ChangelogStateHandleStreamImpl
,EmptyFileMergingOperatorStreamStateHandle
,FileMergingOperatorStreamStateHandle
,FinishedOperatorSubtaskState
,FullyFinishedOperatorState
,IncrementalLocalKeyedStateHandle
,IncrementalRemoteKeyedStateHandle
,InMemoryChangelogStateHandle
,KeyGroupsSavepointStateHandle
,KeyGroupsStateHandle
,OperatorState
,OperatorSubtaskState
,SubtaskState
,TaskState
,TaskStateSnapshot
public interface CompositeStateHandle extends StateObject
Base of all snapshots that are taken byStateBackend
s and some other components in tasks.Each snapshot is composed of a collection of
StateObject
s some of which may be referenced by other checkpoints. The shared states will be registered at the givenSharedStateRegistry
when the handle is received by theCheckpointCoordinator
and will be discarded when the checkpoint is discarded.The
SharedStateRegistry
is responsible for the discarding of registered shared states. Before their first registration throughregisterSharedStates(SharedStateRegistry, long)
, newly created shared state is still owned by this handle and considered as private state until it is registered for the first time. Registration transfers ownership to theSharedStateRegistry
. The composite state handle should only delete all private states in theStateObject.discardState()
method, theSharedStateRegistry
is responsible for deleting shared states after they were registered.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.runtime.state.StateObject
StateObject.StateObjectLocation, StateObject.StateObjectSizeStatsCollector
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
getCheckpointedSize()
Returns the persisted data size during checkpoint execution in bytes.void
registerSharedStates(SharedStateRegistry stateRegistry, long checkpointID)
Register both newly created and already referenced shared states in the givenSharedStateRegistry
.-
Methods inherited from interface org.apache.flink.runtime.state.StateObject
collectSizeStats, discardState, getStateSize
-
-
-
-
Method Detail
-
registerSharedStates
void registerSharedStates(SharedStateRegistry stateRegistry, long checkpointID)
Register both newly created and already referenced shared states in the givenSharedStateRegistry
. This method is called when the checkpoint successfully completes or is recovered from failures.After this is completed, newly created shared state is considered as published is no longer owned by this handle. This means that it should no longer be deleted as part of calls to
StateObject.discardState()
. Instead,StateObject.discardState()
will trigger an unregistration from the registry.- Parameters:
stateRegistry
- The registry where shared states are registered.
-
getCheckpointedSize
long getCheckpointedSize()
Returns the persisted data size during checkpoint execution in bytes. If incremental checkpoint is enabled, this value represents the incremental persisted data size, and usually smaller thanStateObject.getStateSize()
. If the size is unknown, this method would return same result asStateObject.getStateSize()
.- Returns:
- The persisted data size during checkpoint execution in bytes.
-
-