@Internal public class KvStateClientProxyImpl extends AbstractServerBase<KvStateRequest,KvStateResponse> implements KvStateClientProxy
KvStateClientProxy
.log
Constructor and Description |
---|
KvStateClientProxyImpl(InetAddress bindAddress,
Iterator<Integer> bindPortIterator,
Integer numEventLoopThreads,
Integer numQueryThreads,
KvStateRequestStats stats)
Creates the Queryable State Client Proxy.
|
Modifier and Type | Method and Description |
---|---|
KvStateLocationOracle |
getKvStateLocationOracle(JobID jobId)
Retrieves a future containing the currently leading key-value state location oracle.
|
InetSocketAddress |
getServerAddress()
Returns the address of this server.
|
AbstractServerHandler<KvStateRequest,KvStateResponse> |
initializeHandler()
Returns the
handler to be used for
serving the incoming requests. |
void |
shutdown()
Shuts down the server and all related thread pools.
|
void |
start()
Starts the server by binding to the configured bind address (blocking).
|
void |
updateKvStateLocationOracle(JobID jobId,
KvStateLocationOracle kvStateLocationOracle)
Updates the active
Job Manager
in case of change. |
getQueryExecutor, getServerName, isEventGroupShutdown, shutdownServer
public KvStateClientProxyImpl(InetAddress bindAddress, Iterator<Integer> bindPortIterator, Integer numEventLoopThreads, Integer numQueryThreads, KvStateRequestStats stats)
The server is instantiated using reflection by the
QueryableStateUtils.createKvStateClientProxy(InetAddress, Iterator, int, int, KvStateRequestStats)
.
The server needs to be started via start()
in order to bind
to the configured bind address.
bindAddress
- the address to listen to.bindPortIterator
- the port range to try to bind to.numEventLoopThreads
- number of event loop threads.numQueryThreads
- number of query threads.stats
- the statistics collector.public InetSocketAddress getServerAddress()
AbstractServerBase
getServerAddress
in interface KvStateServer
getServerAddress
in class AbstractServerBase<KvStateRequest,KvStateResponse>
public void start() throws Throwable
AbstractServerBase
start
in interface KvStateServer
start
in class AbstractServerBase<KvStateRequest,KvStateResponse>
Throwable
public void shutdown()
KvStateServer
shutdown
in interface KvStateServer
public void updateKvStateLocationOracle(JobID jobId, @Nullable KvStateLocationOracle kvStateLocationOracle)
KvStateClientProxy
Job Manager
in case of change.
This is useful in settings where high-availability is enabled and a failed Job Manager is replaced by a new one.
IMPORTANT: this method may be called by a different thread than
the KvStateClientProxy.getKvStateLocationOracle(JobID)
.
updateKvStateLocationOracle
in interface KvStateClientProxy
jobId
- identifying the job for which to update the key-value state location oraclekvStateLocationOracle
- the key-value state location oracle for the given JobID
,
or null if there is no oracle anymore@Nullable public KvStateLocationOracle getKvStateLocationOracle(JobID jobId)
KvStateClientProxy
IMPORTANT: this method may be called by a different thread than the
KvStateClientProxy.updateKvStateLocationOracle(JobID, KvStateLocationOracle)
.
getKvStateLocationOracle
in interface KvStateClientProxy
jobId
- identifying the job for which to request the key-value state location oracleJobID
or null if none.public AbstractServerHandler<KvStateRequest,KvStateResponse> initializeHandler()
AbstractServerBase
handler
to be used for
serving the incoming requests.initializeHandler
in class AbstractServerBase<KvStateRequest,KvStateResponse>
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.