@Internal public class SharedStateRegistryImpl extends Object implements SharedStateRegistry
SharedStateRegistry implementation.| Modifier and Type | Class and Description |
|---|---|
static class |
SharedStateRegistryImpl.EmptyDiscardStateObjectForRegister
An object with empty discardState for registering.
|
DEFAULT_FACTORY| Constructor and Description |
|---|
SharedStateRegistryImpl()
Default uses direct executor to delete unreferenced state
|
SharedStateRegistryImpl(Executor asyncDisposalExecutor) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkpointCompleted(long checkpointId) |
void |
close() |
void |
registerAll(Iterable<? extends CompositeStateHandle> stateHandles,
long checkpointID)
Register given shared states in the registry.
|
void |
registerAllAfterRestored(CompletedCheckpoint checkpoint,
org.apache.flink.core.execution.RestoreMode mode)
Set the lowest checkpoint ID below which no state is discarded, inclusive.
|
StreamStateHandle |
registerReference(SharedStateRegistryKey registrationKey,
StreamStateHandle newHandle,
long checkpointID,
boolean preventDiscardingCreatedCheckpoint)
Register a reference to the given shared state in the registry.
|
String |
toString() |
Set<Long> |
unregisterUnusedState(long lowestCheckpointID)
Unregister state that is not referenced by the given checkpoint ID or any newer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitregisterReferencepublic SharedStateRegistryImpl()
public SharedStateRegistryImpl(Executor asyncDisposalExecutor)
public StreamStateHandle registerReference(SharedStateRegistryKey registrationKey, StreamStateHandle newHandle, long checkpointID, boolean preventDiscardingCreatedCheckpoint)
SharedStateRegistryIMPORTANT: the caller must use the returned state handle instead of the passed one because the registry might replace or update it.
registerReference in interface SharedStateRegistrynewHandle - the shared state for which we register a reference.checkpointID - which uses the statepreventDiscardingCreatedCheckpoint - as long as this state is still in use. The
"checkpoint that created the state" is recorded on the first state registration.public Set<Long> unregisterUnusedState(long lowestCheckpointID)
SharedStateRegistryunregisterUnusedState in interface SharedStateRegistrylowestCheckpointID - which is still valid.public void registerAll(Iterable<? extends CompositeStateHandle> stateHandles, long checkpointID)
SharedStateRegistryNOTE: For state from checkpoints from other jobs or runs (i.e. after recovery), please use
SharedStateRegistry.registerAllAfterRestored(CompletedCheckpoint, RestoreMode)
registerAll in interface SharedStateRegistrystateHandles - The shared states to register.checkpointID - which uses the states.public void registerAllAfterRestored(CompletedCheckpoint checkpoint, org.apache.flink.core.execution.RestoreMode mode)
SharedStateRegistryAfter recovery from an incremental checkpoint, its state should NOT be discarded, even if
not used anymore (unless recovering in CLAIM mode).
This should hold for both cases: when recovering from that initial checkpoint; and from any subsequent checkpoint derived from it.
registerAllAfterRestored in interface SharedStateRegistrypublic void checkpointCompleted(long checkpointId)
checkpointCompleted in interface SharedStateRegistrypublic void close()
close in interface AutoCloseableCopyright © 2014–2025 The Apache Software Foundation. All rights reserved.