public class SharedStateRegistry extends Object implements AutoCloseable
SharedStateRegistry
will be deployed in the
CheckpointCoordinator
to
maintain the reference count of StreamStateHandle
s by a key that (logically) identifies
them.限定符和类型 | 类和说明 |
---|---|
static class |
SharedStateRegistry.Result
The result of an attempt to (un)/reference state
|
限定符和类型 | 字段和说明 |
---|---|
static SharedStateRegistryFactory |
DEFAULT_FACTORY
A singleton object for the default implementation of a
SharedStateRegistryFactory |
构造器和说明 |
---|
SharedStateRegistry()
Default uses direct executor to delete unreferenced state
|
SharedStateRegistry(Executor asyncDisposalExecutor) |
限定符和类型 | 方法和说明 |
---|---|
void |
close() |
void |
registerAll(Iterable<? extends CompositeStateHandle> stateHandles)
Register given shared states in the registry.
|
SharedStateRegistry.Result |
registerReference(SharedStateRegistryKey registrationKey,
StreamStateHandle state)
Register a reference to the given shared state in the registry.
|
String |
toString() |
SharedStateRegistry.Result |
unregisterReference(SharedStateRegistryKey registrationKey)
Releases one reference to the given shared state in the registry.
|
public static final SharedStateRegistryFactory DEFAULT_FACTORY
SharedStateRegistryFactory
public SharedStateRegistry()
public SharedStateRegistry(Executor asyncDisposalExecutor)
public SharedStateRegistry.Result registerReference(SharedStateRegistryKey registrationKey, StreamStateHandle state)
IMPORTANT: 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.
state
- the shared state for which we register a reference.public SharedStateRegistry.Result unregisterReference(SharedStateRegistryKey registrationKey)
registrationKey
- the shared state for which we release a reference.public void registerAll(Iterable<? extends CompositeStateHandle> stateHandles)
stateHandles
- The shared states to register.public void close()
close
在接口中 AutoCloseable
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.