public class SharedStateRegistry extends Object
SharedStateRegistry will be deployed in the
CheckpointCoordinator to
maintain the reference count of StreamStateHandles by a key that (logically) identifies
them.| Modifier and Type | Class and Description |
|---|---|
static class |
SharedStateRegistry.Result
The result of an attempt to (un)/reference state
|
| Constructor and Description |
|---|
SharedStateRegistry() |
SharedStateRegistry(Executor asyncDisposalExecutor) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears the registry.
|
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.
|
SharedStateRegistry.Result |
unregisterReference(SharedStateRegistryKey registrationKey)
Releases one reference to the given shared state in the registry.
|
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 clear()
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.