Class QueryableStateClient
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
ConstructorsConstructorDescriptionQueryableStateClient(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 TypeMethodDescriptionorg.apache.flink.api.common.ExecutionConfigDeprecated.Gets theExecutionConfig.<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.ExecutionConfigsetExecutionConfig(org.apache.flink.api.common.ExecutionConfig config) Deprecated.Replaces the existingExecutionConfig(possiblynull), with the provided one.setUserClassLoader(ClassLoader userClassLoader) Deprecated.* Replaces the existingClassLoader(possiblynull), with the provided one.Deprecated.Shuts down the client and returns aCompletableFuturethat will be completed when the shutdown process is completed.voidDeprecated.Shuts down the client and waits until shutdown is completed.
-
Constructor Details
-
QueryableStateClient
Deprecated.Create the Queryable State Client.- Parameters:
remoteHostname- the hostname of theClient Proxyto connect to.remotePort- the port of the proxy to connect to.- Throws:
UnknownHostException
-
QueryableStateClient
Deprecated.Create the Queryable State Client.- Parameters:
remoteAddress- theaddressof theClient Proxyto connect to.remotePort- the port of the proxy to connect to.
-
-
Method Details
-
shutdownAndHandle
Deprecated.Shuts down the client and returns aCompletableFuturethat 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
CompletableFuturefor 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 theExecutionConfig. -
setExecutionConfig
public org.apache.flink.api.common.ExecutionConfig setExecutionConfig(org.apache.flink.api.common.ExecutionConfig config) Deprecated.Replaces the existingExecutionConfig(possiblynull), with the provided one.- Parameters:
config- The newconfiguration.- Returns:
- The old configuration, or
nullif none was specified.
-
setUserClassLoader
Deprecated.* Replaces the existingClassLoader(possiblynull), with the provided one.- Parameters:
userClassLoader- The newuserClassLoader.- Returns:
- The old classloader, or
nullif none was specified.
-
getKvState
@PublicEvolving public <K,S extends org.apache.flink.api.common.state.State, CompletableFuture<S> getKvStateV> (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- ATypeHintused to extract the type of the key.stateDescriptor- TheStateDescriptorof the state we want to query.- Returns:
- Future holding the immutable
Stateobject containing the result.
-
getKvState
@PublicEvolving public <K,S extends org.apache.flink.api.common.state.State, CompletableFuture<S> getKvStateV> (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- TheTypeInformationof the key.stateDescriptor- TheStateDescriptorof the state we want to query.- Returns:
- Future holding the immutable
Stateobject containing the result.
-