public class FileMergingOperatorStreamStateHandle extends OperatorStreamStateHandle implements CompositeStateHandle
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.
StateObject.StateObjectLocation, StateObject.StateObjectSizeStatsCollectorOperatorStateHandle.Mode, OperatorStateHandle.StateMetaInfo| Constructor and Description |
|---|
FileMergingOperatorStreamStateHandle(DirectoryStreamStateHandle taskOwnedDirHandle,
DirectoryStreamStateHandle sharedDirHandle,
Map<String,OperatorStateHandle.StateMetaInfo> stateNameToPartitionOffsets,
StreamStateHandle delegateStateHandle) |
| Modifier and Type | Method and 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 given
SharedStateRegistry. |
String |
toString() |
asBytesIfInMemory, collectSizeStats, getDelegateStateHandle, getStateNameToPartitionOffsets, getStateSize, getStreamStateHandleID, openInputStreamclone, finalize, getClass, notify, notifyAll, wait, wait, waitcollectSizeStats, getStateSizepublic FileMergingOperatorStreamStateHandle(DirectoryStreamStateHandle taskOwnedDirHandle, DirectoryStreamStateHandle sharedDirHandle, Map<String,OperatorStateHandle.StateMetaInfo> stateNameToPartitionOffsets, StreamStateHandle delegateStateHandle)
public void registerSharedStates(SharedStateRegistry stateRegistry, long checkpointId)
CompositeStateHandleSharedStateRegistry. 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.
registerSharedStates in interface CompositeStateHandlestateRegistry - The registry where shared states are registered.public void discardState()
throws Exception
StateObjectdiscardState in interface StateObjectdiscardState in class OperatorStreamStateHandleExceptionpublic long getCheckpointedSize()
CompositeStateHandleStateObject.getStateSize(). If the size is unknown, this method would return same
result as StateObject.getStateSize().getCheckpointedSize in interface CompositeStateHandlepublic DirectoryStreamStateHandle getSharedDirHandle()
public DirectoryStreamStateHandle getTaskOwnedDirHandle()
public boolean equals(Object o)
equals in class OperatorStreamStateHandlepublic int hashCode()
hashCode in class OperatorStreamStateHandlepublic String toString()
toString in class OperatorStreamStateHandleCopyright © 2014–2025 The Apache Software Foundation. All rights reserved.