@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 |
---|---|
CompletableFuture<ActorGateway> |
getJobManagerFuture()
Retrieves a future containing the currently leading Job Manager.
|
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 |
updateJobManager(CompletableFuture<ActorGateway> leadingJobManager)
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 updateJobManager(CompletableFuture<ActorGateway> leadingJobManager) throws Exception
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.getJobManagerFuture()
.
updateJobManager
in interface KvStateClientProxy
leadingJobManager
- the currently leading job manager.Exception
public CompletableFuture<ActorGateway> getJobManagerFuture()
KvStateClientProxy
IMPORTANT: this method may be called by a different thread than the
KvStateClientProxy.updateJobManager(CompletableFuture)
.
getJobManagerFuture
in interface KvStateClientProxy
CompletableFuture
containing the currently active Job Manager.public AbstractServerHandler<KvStateRequest,KvStateResponse> initializeHandler()
AbstractServerBase
handler
to be used for
serving the incoming requests.initializeHandler
in class AbstractServerBase<KvStateRequest,KvStateResponse>
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.