@Internal public class SharedStateRegistryImpl extends Object implements SharedStateRegistry
SharedStateRegistry implementation.DEFAULT_FACTORY| 构造器和说明 |
|---|
SharedStateRegistryImpl()
Default uses direct executor to delete unreferenced state
|
SharedStateRegistryImpl(Executor asyncDisposalExecutor) |
| 限定符和类型 | 方法和说明 |
|---|---|
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 在接口中 SharedStateRegistrystate - the shared state for which we register a reference.checkpointID - which uses the statepublic void unregisterUnusedState(long lowestCheckpointID)
SharedStateRegistryunregisterUnusedState 在接口中 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 在接口中 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 在接口中 SharedStateRegistrypublic void checkpointCompleted(long checkpointId)
checkpointCompleted 在接口中 SharedStateRegistrypublic void close()
close 在接口中 AutoCloseableCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.