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.StateObjectSizeStatsCollector
OperatorStateHandle.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, openInputStream
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
collectSizeStats, getStateSize
public FileMergingOperatorStreamStateHandle(DirectoryStreamStateHandle taskOwnedDirHandle, DirectoryStreamStateHandle sharedDirHandle, Map<String,OperatorStateHandle.StateMetaInfo> stateNameToPartitionOffsets, StreamStateHandle delegateStateHandle)
public void registerSharedStates(SharedStateRegistry stateRegistry, long checkpointId)
CompositeStateHandle
SharedStateRegistry
. 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 CompositeStateHandle
stateRegistry
- The registry where shared states are registered.public void discardState() throws Exception
StateObject
discardState
in interface StateObject
discardState
in class OperatorStreamStateHandle
Exception
public long getCheckpointedSize()
CompositeStateHandle
StateObject.getStateSize()
. If the size is unknown, this method would return same
result as StateObject.getStateSize()
.getCheckpointedSize
in interface CompositeStateHandle
public DirectoryStreamStateHandle getSharedDirHandle()
public DirectoryStreamStateHandle getTaskOwnedDirHandle()
public boolean equals(Object o)
equals
in class OperatorStreamStateHandle
public int hashCode()
hashCode
in class OperatorStreamStateHandle
public String toString()
toString
in class OperatorStreamStateHandle
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.