Class QueryableStateClient

java.lang.Object
org.apache.flink.queryablestate.client.QueryableStateClient

@PublicEvolving @Deprecated public class QueryableStateClient extends Object
Deprecated.
The Queryable State feature is deprecated since Flink 1.18, and will be removed in a future Flink major version.
Client for querying Flink's managed state.

You can mark state as queryable via StateDescriptor.setQueryable(String). The state instance created from this descriptor will be published for queries when it's created on the Task Managers and the location will be reported to the Job Manager.

The client connects to a Client Proxy running on a given Task Manager. The proxy is the entry point of the client to the Flink cluster. It forwards the requests of the client to the Job Manager and the required Task Manager, and forwards the final response back the client.

The proxy, initially resolves the location of the requested KvState via the JobManager. Resolved locations are cached. When the server address of the requested KvState instance is determined, the client sends out a request to the server. The returned final answer is then forwarded to the Client.

  • Constructor Summary

    Constructors
    Constructor
    Description
    QueryableStateClient(String remoteHostname, int remotePort)
    Deprecated.
    Create the Queryable State Client.
    QueryableStateClient(InetAddress remoteAddress, int remotePort)
    Deprecated.
    Create the Queryable State Client.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.flink.api.common.ExecutionConfig
    Deprecated.
    Gets the ExecutionConfig.
    <K, S extends org.apache.flink.api.common.state.State, V>
    CompletableFuture<S>
    getKvState(org.apache.flink.api.common.JobID jobId, String queryableStateName, K key, org.apache.flink.api.common.typeinfo.TypeHint<K> keyTypeHint, org.apache.flink.api.common.state.StateDescriptor<S,V> stateDescriptor)
    Deprecated.
    Returns a future holding the request result.
    <K, S extends org.apache.flink.api.common.state.State, V>
    CompletableFuture<S>
    getKvState(org.apache.flink.api.common.JobID jobId, String queryableStateName, K key, org.apache.flink.api.common.typeinfo.TypeInformation<K> keyTypeInfo, org.apache.flink.api.common.state.StateDescriptor<S,V> stateDescriptor)
    Deprecated.
    Returns a future holding the request result.
    org.apache.flink.api.common.ExecutionConfig
    setExecutionConfig(org.apache.flink.api.common.ExecutionConfig config)
    Deprecated.
    Replaces the existing ExecutionConfig (possibly null), with the provided one.
    Deprecated.
    * Replaces the existing ClassLoader (possibly null), with the provided one.
    Deprecated.
    Shuts down the client and returns a CompletableFuture that will be completed when the shutdown process is completed.
    void
    Deprecated.
    Shuts down the client and waits until shutdown is completed.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • QueryableStateClient

      public QueryableStateClient(String remoteHostname, int remotePort) throws UnknownHostException
      Deprecated.
      Create the Queryable State Client.
      Parameters:
      remoteHostname - the hostname of the Client Proxy to connect to.
      remotePort - the port of the proxy to connect to.
      Throws:
      UnknownHostException
    • QueryableStateClient

      public QueryableStateClient(InetAddress remoteAddress, int remotePort)
      Deprecated.
      Create the Queryable State Client.
      Parameters:
      remoteAddress - the address of the Client Proxy to connect to.
      remotePort - the port of the proxy to connect to.
  • Method Details

    • shutdownAndHandle

      public CompletableFuture<?> shutdownAndHandle()
      Deprecated.
      Shuts down the client and returns a CompletableFuture that will be completed when the shutdown process is completed.

      If an exception is thrown for any reason, then the returned future will be completed exceptionally with that exception.

      Returns:
      A CompletableFuture for further handling of the shutdown result.
    • shutdownAndWait

      public void shutdownAndWait()
      Deprecated.
      Shuts down the client and waits until shutdown is completed.

      If an exception is thrown, a warning is logged containing the exception message.

    • getExecutionConfig

      public org.apache.flink.api.common.ExecutionConfig getExecutionConfig()
      Deprecated.
      Gets the ExecutionConfig.
    • setExecutionConfig

      public org.apache.flink.api.common.ExecutionConfig setExecutionConfig(org.apache.flink.api.common.ExecutionConfig config)
      Deprecated.
      Replaces the existing ExecutionConfig (possibly null), with the provided one.
      Parameters:
      config - The new configuration.
      Returns:
      The old configuration, or null if none was specified.
    • setUserClassLoader

      public ClassLoader setUserClassLoader(ClassLoader userClassLoader)
      Deprecated.
      * Replaces the existing ClassLoader (possibly null), with the provided one.
      Parameters:
      userClassLoader - The new userClassLoader.
      Returns:
      The old classloader, or null if none was specified.
    • getKvState

      @PublicEvolving public <K, S extends org.apache.flink.api.common.state.State, V> CompletableFuture<S> getKvState(org.apache.flink.api.common.JobID jobId, String queryableStateName, K key, org.apache.flink.api.common.typeinfo.TypeHint<K> keyTypeHint, org.apache.flink.api.common.state.StateDescriptor<S,V> stateDescriptor)
      Deprecated.
      Returns a future holding the request result.
      Parameters:
      jobId - JobID of the job the queryable state belongs to.
      queryableStateName - Name under which the state is queryable.
      key - The key we are interested in.
      keyTypeHint - A TypeHint used to extract the type of the key.
      stateDescriptor - The StateDescriptor of the state we want to query.
      Returns:
      Future holding the immutable State object containing the result.
    • getKvState

      @PublicEvolving public <K, S extends org.apache.flink.api.common.state.State, V> CompletableFuture<S> getKvState(org.apache.flink.api.common.JobID jobId, String queryableStateName, K key, org.apache.flink.api.common.typeinfo.TypeInformation<K> keyTypeInfo, org.apache.flink.api.common.state.StateDescriptor<S,V> stateDescriptor)
      Deprecated.
      Returns a future holding the request result.
      Parameters:
      jobId - JobID of the job the queryable state belongs to.
      queryableStateName - Name under which the state is queryable.
      key - The key we are interested in.
      keyTypeInfo - The TypeInformation of the key.
      stateDescriptor - The StateDescriptor of the state we want to query.
      Returns:
      Future holding the immutable State object containing the result.