@ThreadSafe public class RpcClientManager extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
RPC_IDLE_TIMEOUT |
static int |
RPC_RETRIES |
| Modifier and Type | Method and Description |
|---|---|
static void |
cleanup(NettyClientBase... clients) |
static void |
close()
Request to close this clients
After it is closed, it is removed from clients map.
|
protected static boolean |
contains(org.apache.tajo.rpc.RpcClientManager.RpcConnectionKey key) |
NettyClientBase |
getClient(InetSocketAddress addr,
Class<?> protocolClass,
boolean asyncMode)
Connect a
NettyClientBase to the remote NettyServerBase, and returns rpc client by protocol. |
static RpcClientManager |
getInstance() |
protected static NettyClientBase |
remove(org.apache.tajo.rpc.RpcClientManager.RpcConnectionKey key) |
static void |
shutdown()
Close client manager and shutdown Netty RPC worker pool
After it is shutdown it is not possible to reuse it again.
|
public static final int RPC_RETRIES
public static final int RPC_IDLE_TIMEOUT
public static RpcClientManager getInstance()
public NettyClientBase getClient(InetSocketAddress addr, Class<?> protocolClass, boolean asyncMode) throws NoSuchMethodException, ClassNotFoundException, io.netty.channel.ConnectTimeoutException
NettyClientBase to the remote NettyServerBase, and returns rpc client by protocol.
This client will be shared per protocol and address. Client is removed in shared map when a client is closedaddr - protocolClass - asyncMode - NoSuchMethodExceptionClassNotFoundExceptionio.netty.channel.ConnectTimeoutExceptionpublic static void close()
public static void shutdown()
protected static NettyClientBase remove(org.apache.tajo.rpc.RpcClientManager.RpcConnectionKey key)
protected static boolean contains(org.apache.tajo.rpc.RpcClientManager.RpcConnectionKey key)
public static void cleanup(NettyClientBase... clients)
Copyright © 2015 Apache Software Foundation. All Rights Reserved.