Class FileMergingOperatorStreamStateHandle
- java.lang.Object
-
- org.apache.flink.runtime.state.OperatorStreamStateHandle
-
- org.apache.flink.runtime.state.filemerging.FileMergingOperatorStreamStateHandle
-
- All Implemented Interfaces:
Serializable
,CompositeStateHandle
,OperatorStateHandle
,StateObject
,StreamStateHandle
- Direct Known Subclasses:
EmptyFileMergingOperatorStreamStateHandle
public class FileMergingOperatorStreamStateHandle extends OperatorStreamStateHandle implements CompositeStateHandle
AOperatorStreamStateHandle
that works for file merging checkpoints.Operator states are stored in `taskownd/` dir when file merging is enabled. When an operator state dir is not referenced by any checkpoint,
SharedStateRegistry
will discard it. The shared subtask dir of fire merging is also tracked byFileMergingOperatorStreamStateHandle
.The shared subtask dir of file merging is created when task initialization, which will be discarded when no checkpoint refer to it.
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.runtime.state.OperatorStateHandle
OperatorStateHandle.Mode, OperatorStateHandle.StateMetaInfo
-
Nested classes/interfaces inherited from interface org.apache.flink.runtime.state.StateObject
StateObject.StateObjectLocation, StateObject.StateObjectSizeStatsCollector
-
-
Constructor Summary
Constructors Constructor Description FileMergingOperatorStreamStateHandle(DirectoryStreamStateHandle taskOwnedDirHandle, DirectoryStreamStateHandle sharedDirHandle, Map<String,OperatorStateHandle.StateMetaInfo> stateNameToPartitionOffsets, StreamStateHandle delegateStateHandle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
discardState()
Discards the state referred to and solemnly owned by this handle, to free up resources in the persistent storage.boolean
equals(Object o)
long
getCheckpointedSize()
Returns the persisted data size during checkpoint execution in bytes.DirectoryStreamStateHandle
getSharedDirHandle()
DirectoryStreamStateHandle
getTaskOwnedDirHandle()
int
hashCode()
void
registerSharedStates(SharedStateRegistry stateRegistry, long checkpointId)
Register both newly created and already referenced shared states in the givenSharedStateRegistry
.String
toString()
-
Methods inherited from class org.apache.flink.runtime.state.OperatorStreamStateHandle
asBytesIfInMemory, collectSizeStats, getDelegateStateHandle, getStateNameToPartitionOffsets, getStateSize, getStreamStateHandleID, maybeGetPath, openInputStream
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.flink.runtime.state.StateObject
collectSizeStats, getStateSize
-
-
-
-
Constructor Detail
-
FileMergingOperatorStreamStateHandle
public FileMergingOperatorStreamStateHandle(DirectoryStreamStateHandle taskOwnedDirHandle, DirectoryStreamStateHandle sharedDirHandle, Map<String,OperatorStateHandle.StateMetaInfo> stateNameToPartitionOffsets, StreamStateHandle delegateStateHandle)
-
-
Method Detail
-
registerSharedStates
public void registerSharedStates(SharedStateRegistry stateRegistry, long checkpointId)
Description copied from interface:CompositeStateHandle
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.- Specified by:
registerSharedStates
in interfaceCompositeStateHandle
- Parameters:
stateRegistry
- The registry where shared states are registered.
-
discardState
public void discardState() throws Exception
Description copied from interface:StateObject
Discards the state referred to and solemnly owned by this handle, to free up resources in the persistent storage. This method is called when the state represented by this object will not be used anymore.- Specified by:
discardState
in interfaceStateObject
- Overrides:
discardState
in classOperatorStreamStateHandle
- Throws:
Exception
-
getCheckpointedSize
public long getCheckpointedSize()
Description copied from interface:CompositeStateHandle
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()
.- Specified by:
getCheckpointedSize
in interfaceCompositeStateHandle
- Returns:
- The persisted data size during checkpoint execution in bytes.
-
getSharedDirHandle
public DirectoryStreamStateHandle getSharedDirHandle()
-
getTaskOwnedDirHandle
public DirectoryStreamStateHandle getTaskOwnedDirHandle()
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classOperatorStreamStateHandle
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classOperatorStreamStateHandle
-
toString
public String toString()
- Overrides:
toString
in classOperatorStreamStateHandle
-
-