@Internal public class SharedStateRegistryImpl extends Object implements SharedStateRegistry
SharedStateRegistry implementation.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,
RestoreMode mode)
Set the lowest checkpoint ID below which no state is discarded, inclusive.
|
StreamStateHandle |
registerReference(SharedStateRegistryKey registrationKey,
StreamStateHandle state,
long checkpointID)
Register a reference to the given shared state in the registry.
|
String |
toString() |
void |
unregisterUnusedState(long lowestCheckpointID)
Unregister state that is not referenced by the given checkpoint ID or any newer.
|
public SharedStateRegistryImpl()
public SharedStateRegistryImpl(Executor asyncDisposalExecutor)
public StreamStateHandle registerReference(SharedStateRegistryKey registrationKey, StreamStateHandle state, long checkpointID)
SharedStateRegistryIMPORTANT: caller should check the state handle returned by the result, because the registry is performing de-duplication and could potentially return a handle that is supposed to replace the one from the registration request.
registerReference in interface SharedStateRegistrystate - the shared state for which we register a reference.checkpointID - which uses the statepublic void unregisterUnusedState(long lowestCheckpointID)
SharedStateRegistryunregisterUnusedState in interface SharedStateRegistrylowestCheckpointID - which is still validpublic 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, 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–2023 The Apache Software Foundation. All rights reserved.