Package org.apache.flink.runtime.query
Class KvStateLocation
java.lang.Object
org.apache.flink.runtime.query.KvStateLocation
- All Implemented Interfaces:
Serializable
Location information for all key groups of a
InternalKvState instance.
This is populated by the KvStateLocationRegistry and used by the queryable state to
target queries.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionKvStateLocation(org.apache.flink.api.common.JobID jobId, JobVertexID jobVertexId, int numKeyGroups, String registrationName) Creates the location information. -
Method Summary
Modifier and TypeMethodDescriptionbooleanorg.apache.flink.api.common.JobIDgetJobId()Returns the JobID the KvState instances belong to.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.getKvStateServerAddress(int keyGroupIndex) Returns the registered server address for the key group index ornullif none is registered yet.intReturns the number of key groups of the operator the KvState instances belong to.intReturns the current number of registered key groups.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.toString()
-
Constructor Details
-
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 Details
-
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
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
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
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
-
toString
-
equals
-
hashCode
public int hashCode()
-