Class KvStateRegistry


  • public class KvStateRegistry
    extends Object
    A registry for 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 Detail

      • KvStateRegistry

        public KvStateRegistry()
    • Method Detail

      • unregisterListener

        public void unregisterListener​(JobID jobId)
        Unregisters the listener with the registry.
        Parameters:
        jobId - for which to unregister the KvStateRegistryListener
      • registerKvState

        public KvStateID registerKvState​(JobID jobId,
                                         JobVertexID jobVertexId,
                                         KeyGroupRange keyGroupRange,
                                         String registrationName,
                                         InternalKvState<?,​?,​?> kvState,
                                         ClassLoader userClassLoader)
        Registers the KvState instance and returns the assigned ID.
        Parameters:
        jobId - JobId the KvState instance belongs to
        jobVertexId - JobVertexID the KvState instance belongs to
        keyGroupRange - Key group range the KvState instance belongs to
        registrationName - Name under which the KvState is registered
        kvState - KvState instance to be registered
        Returns:
        Assigned KvStateID
      • unregisterKvState

        public void unregisterKvState​(JobID jobId,
                                      JobVertexID jobVertexId,
                                      KeyGroupRange keyGroupRange,
                                      String registrationName,
                                      KvStateID kvStateId)
        Unregisters the KvState instance identified by the given KvStateID.
        Parameters:
        jobId - JobId the KvState instance belongs to
        kvStateId - KvStateID to identify the KvState instance
        keyGroupRange - Key group range the KvState instance belongs to
      • getKvState

        public KvStateEntry<?,​?,​?> getKvState​(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.
        Parameters:
        kvStateId - KvStateID to identify the KvState instance
        Returns:
        The KvStateEntry instance identified by the KvStateID or null if there is none