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. |
KvStateEntry<?,?,?> |
getKvState(KvStateID kvStateId)
Returns the
KvStateEntry containing the requested instance as identified by the
given KvStateID, along with its KvStateInfo 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(JobID jobId,
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(JobID jobId)
Unregisters the listener with the registry.
|
public void registerListener(JobID jobId, KvStateRegistryListener listener)
jobId
- identifying the job for which to register a KvStateRegistryListener
listener
- The registry listener.IllegalStateException
- If there is a registered listenerpublic void unregisterListener(JobID jobId)
jobId
- for which to unregister the KvStateRegistryListener
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 KvStateEntry<?,?,?> getKvState(KvStateID kvStateId)
KvStateEntry
containing the requested instance as identified by the
given KvStateID, along with its KvStateInfo
or null
if none is registered.kvStateId
- KvStateID to identify the KvState instanceKvStateEntry
instance identified by the KvStateID or null
if there is nonepublic 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–2019 The Apache Software Foundation. All rights reserved.