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 a InternalKvState instance.

This is populated by the KvStateLocationRegistry and used by the queryable state to target queries.

See Also:
  • 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 to
      jobVertexId - JobVertexID the KvState instances belong to
      numKeyGroups - Number of key groups of the operator
      registrationName - 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

      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 or null if none is registered yet.
      Parameters:
      keyGroupIndex - Key group index to get ID for.
      Returns:
      KvStateID for the key group index or null if 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 or null if none is registered yet.
      Parameters:
      keyGroupIndex - Key group index to get server address for.
      Returns:
      the server address for the key group index or null if 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 register
      kvStateId - 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

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object