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
A
OperatorStreamStateHandle 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 by FileMergingOperatorStreamStateHandle.
The shared subtask dir of file merging is created when task initialization, which will be discarded when no checkpoint refer to it.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.flink.runtime.state.OperatorStateHandle
OperatorStateHandle.Mode, OperatorStateHandle.StateMetaInfoNested classes/interfaces inherited from interface org.apache.flink.runtime.state.StateObject
StateObject.StateObjectLocation, StateObject.StateObjectSizeStatsCollector -
Constructor Summary
ConstructorsConstructorDescriptionFileMergingOperatorStreamStateHandle(DirectoryStreamStateHandle taskOwnedDirHandle, DirectoryStreamStateHandle sharedDirHandle, Map<String, OperatorStateHandle.StateMetaInfo> stateNameToPartitionOffsets, StreamStateHandle delegateStateHandle) -
Method Summary
Modifier and TypeMethodDescriptionvoidDiscards the state referred to and solemnly owned by this handle, to free up resources in the persistent storage.booleanlongReturns the persisted data size during checkpoint execution in bytes.inthashCode()voidregisterSharedStates(SharedStateRegistry stateRegistry, long checkpointId) Register both newly created and already referenced shared states in the givenSharedStateRegistry.toString()Methods inherited from class org.apache.flink.runtime.state.OperatorStreamStateHandle
asBytesIfInMemory, collectSizeStats, getDelegateStateHandle, getStateNameToPartitionOffsets, getStateSize, getStreamStateHandleID, maybeGetPath, openInputStreamMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.flink.runtime.state.StateObject
collectSizeStats, getStateSize
-
Constructor Details
-
FileMergingOperatorStreamStateHandle
public FileMergingOperatorStreamStateHandle(DirectoryStreamStateHandle taskOwnedDirHandle, DirectoryStreamStateHandle sharedDirHandle, Map<String, OperatorStateHandle.StateMetaInfo> stateNameToPartitionOffsets, StreamStateHandle delegateStateHandle)
-
-
Method Details
-
discardState
Description 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.
-
getTaskOwnedDirHandle
-
equals
- Overrides:
equalsin classOperatorStreamStateHandle
-
hashCode
public int hashCode()- Overrides:
hashCodein classOperatorStreamStateHandle
-
toString
- Overrides:
toStringin classOperatorStreamStateHandle