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
AOperatorStreamStateHandlethat 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,
SharedStateRegistrywill 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 voiddiscardState()Discards the state referred to and solemnly owned by this handle, to free up resources in the persistent storage.booleanequals(Object o)longgetCheckpointedSize()Returns the persisted data size during checkpoint execution in bytes.DirectoryStreamStateHandlegetSharedDirHandle()DirectoryStreamStateHandlegetTaskOwnedDirHandle()inthashCode()voidregisterSharedStates(SharedStateRegistry stateRegistry, long checkpointId)Register both newly created and already referenced shared states in the givenSharedStateRegistry.StringtoString()-
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:CompositeStateHandleRegister 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:
registerSharedStatesin interfaceCompositeStateHandle- Parameters:
stateRegistry- The registry where shared states are registered.
-
discardState
public void discardState() throws ExceptionDescription copied from interface:StateObjectDiscards 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:
discardStatein interfaceStateObject- Overrides:
discardStatein classOperatorStreamStateHandle- Throws:
Exception
-
getCheckpointedSize
public long getCheckpointedSize()
Description copied from interface:CompositeStateHandleReturns 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:
getCheckpointedSizein 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:
equalsin classOperatorStreamStateHandle
-
hashCode
public int hashCode()
- Overrides:
hashCodein classOperatorStreamStateHandle
-
toString
public String toString()
- Overrides:
toStringin classOperatorStreamStateHandle
-
-