Package org.apache.flink.runtime.query
Class KvStateLocationRegistry
- java.lang.Object
-
- org.apache.flink.runtime.query.KvStateLocationRegistry
-
public class KvStateLocationRegistry extends Object
Simple registry, which mapsInternalKvState
registration notifications toKvStateLocation
instances.
-
-
Constructor Summary
Constructors Constructor Description KvStateLocationRegistry(JobID jobId, Map<JobVertexID,ExecutionJobVertex> jobVertices)
Creates the registry for the job.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KvStateLocation
getKvStateLocation(String registrationName)
Returns theKvStateLocation
for the registered KvState instance ornull
if no location information is available.void
notifyKvStateRegistered(JobVertexID jobVertexId, KeyGroupRange keyGroupRange, String registrationName, KvStateID kvStateId, InetSocketAddress kvStateServerAddress)
Notifies the registry about a registered KvState instance.void
notifyKvStateUnregistered(JobVertexID jobVertexId, KeyGroupRange keyGroupRange, String registrationName)
Notifies the registry about an unregistered KvState instance.
-
-
-
Constructor Detail
-
KvStateLocationRegistry
public KvStateLocationRegistry(JobID jobId, Map<JobVertexID,ExecutionJobVertex> jobVertices)
Creates the registry for the job.- Parameters:
jobId
- JobID this coordinator belongs to.jobVertices
- Job vertices map of all vertices of this job.
-
-
Method Detail
-
getKvStateLocation
public KvStateLocation getKvStateLocation(String registrationName)
Returns theKvStateLocation
for the registered KvState instance ornull
if no location information is available.- Parameters:
registrationName
- Name under which the KvState instance is registered.- Returns:
- Location information or
null
.
-
notifyKvStateRegistered
public void notifyKvStateRegistered(JobVertexID jobVertexId, KeyGroupRange keyGroupRange, String registrationName, KvStateID kvStateId, InetSocketAddress kvStateServerAddress)
Notifies the registry about a registered KvState instance.- Parameters:
jobVertexId
- JobVertexID the KvState instance belongs tokeyGroupRange
- Key group range the KvState instance belongs toregistrationName
- Name under which the KvState has been registeredkvStateId
- ID of the registered KvState instancekvStateServerAddress
- Server address where to find the KvState instance- Throws:
IllegalArgumentException
- If JobVertexID does not belong to jobIllegalArgumentException
- If state has been registered with same name by another operator.IndexOutOfBoundsException
- If key group index is out of bounds.
-
notifyKvStateUnregistered
public void notifyKvStateUnregistered(JobVertexID jobVertexId, KeyGroupRange keyGroupRange, String registrationName)
Notifies the registry about an unregistered KvState instance.- Parameters:
jobVertexId
- JobVertexID the KvState instance belongs tokeyGroupRange
- Key group index the KvState instance belongs toregistrationName
- Name under which the KvState has been registered- Throws:
IllegalArgumentException
- If another operator registered the state instanceIllegalArgumentException
- If the registration name is not known
-
-