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(org.apache.flink.api.common.JobID jobId,
JobVertexID jobVertexId)
Creates a
TaskKvStateRegistry facade for the Task
identified by the given JobID and JobVertexID instance. |
KvStateEntry<?,?,?> |
getKvState(org.apache.flink.queryablestate.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. |
org.apache.flink.queryablestate.KvStateID |
registerKvState(org.apache.flink.api.common.JobID jobId,
JobVertexID jobVertexId,
KeyGroupRange keyGroupRange,
String registrationName,
InternalKvState<?,?,?> kvState)
Registers the KvState instance and returns the assigned ID.
|
void |
registerListener(org.apache.flink.api.common.JobID jobId,
KvStateRegistryListener listener)
Registers a listener with the registry.
|
void |
unregisterKvState(org.apache.flink.api.common.JobID jobId,
JobVertexID jobVertexId,
KeyGroupRange keyGroupRange,
String registrationName,
org.apache.flink.queryablestate.KvStateID kvStateId)
Unregisters the KvState instance identified by the given KvStateID.
|
void |
unregisterListener(org.apache.flink.api.common.JobID jobId)
Unregisters the listener with the registry.
|
public void registerListener(org.apache.flink.api.common.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(org.apache.flink.api.common.JobID jobId)
jobId
- for which to unregister the KvStateRegistryListener
public org.apache.flink.queryablestate.KvStateID registerKvState(org.apache.flink.api.common.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(org.apache.flink.api.common.JobID jobId, JobVertexID jobVertexId, KeyGroupRange keyGroupRange, String registrationName, org.apache.flink.queryablestate.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(org.apache.flink.queryablestate.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(org.apache.flink.api.common.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.