public class QueryableStateClient extends Object
You can mark state as queryable via
The state instance created from this descriptor will be published for queries
when it's created on the TaskManagers and the location will be reported to
The client 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.
|Constructor and Description|
Creates a client from the given configuration.
Creates a client.
|Modifier and Type||Method and Description|
Returns the execution context of this client.
Returns a future holding the serialized request result.
Shuts down the client and all components.
public QueryableStateClient(Configuration config) throws Exception
This will create multiple Thread pools: one for the started actor system and another for the network client.
config- Configuration to use.
Exception- Failures are forwarded
public QueryableStateClient(KvStateLocationLookupService lookupService, KvStateClient kvStateClient, scala.concurrent.ExecutionContext executionContext)
lookupService- Location lookup service
kvStateClient- Network client for queries
executionContext- Execution context for futures
public scala.concurrent.ExecutionContext getExecutionContext()
public void shutDown()
public scala.concurrent.Future<byte> getKvState(JobID jobId, String queryableStateName, int keyHashCode, byte serializedKeyAndNamespace)
If the server does not serve a KvState instance with the given ID,
the Future will be failed with a
If the KvState instance does not hold any data for the given key
and namespace, the Future will be failed with a
All other failures are forwarded to the Future.
jobId- JobID of the job the queryable state belongs to
queryableStateName- Name under which the state is queryable
keyHashCode- Integer hash code of the key (result of a call to
serializedKeyAndNamespace- Serialized key and namespace to query KvState instance with
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.