public class KvStateRegistry extends Object
InternalKvState
instances per task manager.
This is currently only used for KvState queries: KvState instances, which
are marked as queryable in their state descriptor are registered here and
can be queried by the KvStateServer
.
KvState is registered when it is created/restored and unregistered when the owning operator stops running.
Constructor and Description |
---|
KvStateRegistry() |
Modifier and Type | Method and Description |
---|---|
TaskKvStateRegistry |
createTaskRegistry(JobID jobId,
JobVertexID jobVertexId)
Creates a
TaskKvStateRegistry facade for the Task
identified by the given JobID and JobVertexID instance. |
InternalKvState<?> |
getKvState(KvStateID kvStateId)
Returns the KvState instance identified by the given KvStateID or
null if none is registered. |
KvStateID |
registerKvState(JobID jobId,
JobVertexID jobVertexId,
KeyGroupRange keyGroupRange,
String registrationName,
InternalKvState<?> kvState)
Registers the KvState instance and returns the assigned ID.
|
void |
registerListener(KvStateRegistryListener listener)
Registers a listener with the registry.
|
void |
unregisterKvState(JobID jobId,
JobVertexID jobVertexId,
KeyGroupRange keyGroupRange,
String registrationName,
KvStateID kvStateId)
Unregisters the KvState instance identified by the given KvStateID.
|
void |
unregisterListener()
Unregisters the listener with the registry.
|
public void registerListener(KvStateRegistryListener listener)
listener
- The registry listener.IllegalStateException
- If there is a registered listenerpublic void unregisterListener()
public KvStateID registerKvState(JobID jobId, JobVertexID jobVertexId, KeyGroupRange keyGroupRange, String registrationName, InternalKvState<?> kvState)
jobId
- JobId the KvState instance belongs tojobVertexId
- JobVertexID the KvState instance belongs tokeyGroupRange
- Key group range the KvState instance belongs toregistrationName
- Name under which the KvState is registeredkvState
- KvState instance to be registeredpublic void unregisterKvState(JobID jobId, JobVertexID jobVertexId, KeyGroupRange keyGroupRange, String registrationName, KvStateID kvStateId)
jobId
- JobId the KvState instance belongs tokvStateId
- KvStateID to identify the KvState instancekeyGroupRange
- Key group range the KvState instance belongs topublic InternalKvState<?> getKvState(KvStateID kvStateId)
null
if none is registered.kvStateId
- KvStateID to identify the KvState instancenull
public TaskKvStateRegistry createTaskRegistry(JobID jobId, JobVertexID jobVertexId)
TaskKvStateRegistry
facade for the Task
identified by the given JobID and JobVertexID instance.jobId
- JobID of the taskjobVertexId
- JobVertexID of the taskTaskKvStateRegistry
facade for the taskCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.