Package org.apache.flink.runtime.query
Class KvStateLocation
- java.lang.Object
-
- org.apache.flink.runtime.query.KvStateLocation
-
- All Implemented Interfaces:
Serializable
public class KvStateLocation extends Object implements Serializable
Location information for all key groups of aInternalKvStateinstance.This is populated by the
KvStateLocationRegistryand used by the queryable state to target queries.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description KvStateLocation(org.apache.flink.api.common.JobID jobId, JobVertexID jobVertexId, int numKeyGroups, String registrationName)Creates the location information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)org.apache.flink.api.common.JobIDgetJobId()Returns the JobID the KvState instances belong to.JobVertexIDgetJobVertexId()Returns the JobVertexID the KvState instances belong to.org.apache.flink.queryablestate.KvStateIDgetKvStateID(int keyGroupIndex)Returns the registered KvStateID for the key group index ornullif none is registered yet.InetSocketAddressgetKvStateServerAddress(int keyGroupIndex)Returns the registered server address for the key group index ornullif none is registered yet.intgetNumKeyGroups()Returns the number of key groups of the operator the KvState instances belong to.intgetNumRegisteredKeyGroups()Returns the current number of registered key groups.StringgetRegistrationName()Returns the name under which the KvState instances have been registered.inthashCode()voidregisterKvState(KeyGroupRange keyGroupRange, org.apache.flink.queryablestate.KvStateID kvStateId, InetSocketAddress kvStateAddress)Registers a KvState instance for the given key group index.StringtoString()
-
-
-
Constructor Detail
-
KvStateLocation
public KvStateLocation(org.apache.flink.api.common.JobID jobId, JobVertexID jobVertexId, int numKeyGroups, String registrationName)Creates the location information.- Parameters:
jobId- JobID the KvState instances belong tojobVertexId- JobVertexID the KvState instances belong tonumKeyGroups- Number of key groups of the operatorregistrationName- Name under which the KvState instances have been registered
-
-
Method Detail
-
getJobId
public org.apache.flink.api.common.JobID getJobId()
Returns the JobID the KvState instances belong to.- Returns:
- JobID the KvState instances belong to
-
getJobVertexId
public JobVertexID getJobVertexId()
Returns the JobVertexID the KvState instances belong to.- Returns:
- JobVertexID the KvState instances belong to
-
getNumKeyGroups
public int getNumKeyGroups()
Returns the number of key groups of the operator the KvState instances belong to.- Returns:
- Number of key groups of the operator the KvState instances belong to
-
getRegistrationName
public String getRegistrationName()
Returns the name under which the KvState instances have been registered.- Returns:
- Name under which the KvState instances have been registered.
-
getNumRegisteredKeyGroups
public int getNumRegisteredKeyGroups()
Returns the current number of registered key groups.- Returns:
- Number of registered key groups.
-
getKvStateID
public org.apache.flink.queryablestate.KvStateID getKvStateID(int keyGroupIndex)
Returns the registered KvStateID for the key group index ornullif none is registered yet.- Parameters:
keyGroupIndex- Key group index to get ID for.- Returns:
- KvStateID for the key group index or
nullif none is registered yet - Throws:
IndexOutOfBoundsException- If key group index < 0 or >= Number of key groups
-
getKvStateServerAddress
public InetSocketAddress getKvStateServerAddress(int keyGroupIndex)
Returns the registered server address for the key group index ornullif none is registered yet.- Parameters:
keyGroupIndex- Key group index to get server address for.- Returns:
- the server address for the key group index or
nullif none is registered yet - Throws:
IndexOutOfBoundsException- If key group index < 0 or >= Number of key groups
-
registerKvState
public void registerKvState(KeyGroupRange keyGroupRange, org.apache.flink.queryablestate.KvStateID kvStateId, InetSocketAddress kvStateAddress)
Registers a KvState instance for the given key group index.- Parameters:
keyGroupRange- Key group range to registerkvStateId- ID of the KvState instance at the key group index.kvStateAddress- Server address of the KvState instance at the key group index.- Throws:
IndexOutOfBoundsException- If key group range start < 0 or key group range end >= Number of key groups
-
-