public interface CompositeStateHandle extends StateObject
StateBackend
s and some other
components in tasks.
Each snapshot is composed of a collection of StateObject
s some of
which may be referenced by other checkpoints. The shared states will be
registered at the given SharedStateRegistry
when the handle is
received by the CheckpointCoordinator
and will be discarded when the checkpoint is discarded.
The SharedStateRegistry
is responsible for the discarding of registered
shared states. Before their first registration through
registerSharedStates(SharedStateRegistry)
, newly created shared state is still owned by
this handle and considered as private state until it is registered for the first time. Registration
transfers ownership to the SharedStateRegistry
.
The composite state handle should only delete all private states in the
StateObject.discardState()
method, the SharedStateRegistry
is responsible for
deleting shared states after they were registered.
Modifier and Type | Method and Description |
---|---|
void |
registerSharedStates(SharedStateRegistry stateRegistry)
Register both newly created and already referenced shared states in the given
SharedStateRegistry . |
discardState, getStateSize
void registerSharedStates(SharedStateRegistry stateRegistry)
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.
stateRegistry
- The registry where shared states are registered.Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.