@InterfaceAudience.Private public class RpcClientImpl extends AbstractRpcClient
See HBaseServer
| Modifier and Type | Class and Description | 
|---|---|
| protected class  | RpcClientImpl.ConnectionThread that reads responses and notifies callers. | 
AbstractRpcClient.BlockingRpcChannelImplementation| Modifier and Type | Field and Description | 
|---|---|
| protected AtomicInteger | callIdCnt | 
| protected PoolMap<ConnectionId,RpcClientImpl.Connection> | connections | 
| protected FailedServers | failedServers | 
| protected AtomicBoolean | running | 
| protected SocketFactory | socketFactory | 
| protected static Map<org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos.TokenIdentifier.Kind,org.apache.hadoop.security.token.TokenSelector<? extends org.apache.hadoop.security.token.TokenIdentifier>> | tokenHandlers | 
clusterId, codec, compressor, conf, connectTO, failureSleep, fallbackAllowed, ipcUtil, localAddr, maxRetries, metrics, minIdleTimeBeforeClose, readTO, tcpKeepAlive, tcpNoDelay, userProvider, writeTODEFAULT_CODEC_CLASS, DEFAULT_SOCKET_TIMEOUT_CONNECT, DEFAULT_SOCKET_TIMEOUT_READ, DEFAULT_SOCKET_TIMEOUT_WRITE, FAILED_SERVER_EXPIRY_DEFAULT, FAILED_SERVER_EXPIRY_KEY, IDLE_TIME, IPC_CLIENT_FALLBACK_TO_SIMPLE_AUTH_ALLOWED_DEFAULT, IPC_CLIENT_FALLBACK_TO_SIMPLE_AUTH_ALLOWED_KEY, PING_CALL_ID, SOCKET_TIMEOUT_CONNECT, SOCKET_TIMEOUT_READ, SOCKET_TIMEOUT_WRITE, SPECIFIC_WRITE_THREAD| Constructor and Description | 
|---|
| RpcClientImpl(org.apache.hadoop.conf.Configuration conf,
             String clusterId,
             SocketAddress localAddr,
             MetricsConnection metrics)Construct an IPC client for the cluster  clusterIdwith the default SocketFactory
 This method is called with reflection by the RpcClientFactory to create an instance | 
| Modifier and Type | Method and Description | 
|---|---|
| protected Pair<com.google.protobuf.Message,CellScanner> | call(PayloadCarryingRpcController pcrc,
    com.google.protobuf.Descriptors.MethodDescriptor md,
    com.google.protobuf.Message param,
    com.google.protobuf.Message returnType,
    User ticket,
    InetSocketAddress addr,
    MetricsConnection.CallStats callStats)Make a call, passing  param, to the IPC server running ataddresswhich is servicing theprotocolprotocol,
 with theticketcredentials, returning the value. | 
| void | cancelConnections(ServerName sn)Interrupt the connections to the given ip:port server. | 
| void | close()Stop all threads related to this client. | 
| protected RpcClientImpl.Connection | createConnection(ConnectionId remoteId,
                Codec codec,
                org.apache.hadoop.io.compress.CompressionCodec compressor)Creates a connection. | 
| protected RpcClientImpl.Connection | getConnection(User ticket,
             Call call,
             InetSocketAddress addr)Get a connection from the pool, or create a new one and add it to the
 pool. | 
createBlockingRpcChannel, getDefaultCodec, getPoolSize, getPoolType, hasCellBlockSupport, wrapExceptionprotected final AtomicInteger callIdCnt
protected final PoolMap<ConnectionId,RpcClientImpl.Connection> connections
protected final AtomicBoolean running
protected final FailedServers failedServers
protected final SocketFactory socketFactory
protected static final Map<org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos.TokenIdentifier.Kind,org.apache.hadoop.security.token.TokenSelector<? extends org.apache.hadoop.security.token.TokenIdentifier>> tokenHandlers
public RpcClientImpl(org.apache.hadoop.conf.Configuration conf,
             String clusterId,
             SocketAddress localAddr,
             MetricsConnection metrics)
clusterId with the default SocketFactory
 This method is called with reflection by the RpcClientFactory to create an instanceconf - configurationclusterId - the cluster idlocalAddr - client socket bind address.metrics - the connection metricsprotected RpcClientImpl.Connection createConnection(ConnectionId remoteId, Codec codec, org.apache.hadoop.io.compress.CompressionCodec compressor) throws IOException
remoteId - - the ConnectionId to use for the connection creation.IOExceptionpublic void close()
protected Pair<com.google.protobuf.Message,CellScanner> call(PayloadCarryingRpcController pcrc, com.google.protobuf.Descriptors.MethodDescriptor md, com.google.protobuf.Message param, com.google.protobuf.Message returnType, User ticket, InetSocketAddress addr, MetricsConnection.CallStats callStats) throws IOException, InterruptedException
param, to the IPC server running at
 address which is servicing the protocol protocol,
 with the ticket credentials, returning the value.
 Throws exceptions if there are network problems or if the remote code
 threw an exception.call in class AbstractRpcClientticket - Be careful which ticket you pass. A new user will mean a new Connection.
          UserProvider.getCurrent() makes a new instance of User each time so will be a
          new Connection each time.InterruptedExceptionIOExceptionpublic void cancelConnections(ServerName sn)
sn - server location to cancel connections ofprotected RpcClientImpl.Connection getConnection(User ticket, Call call, InetSocketAddress addr) throws IOException
IOExceptionCopyright © 2007–2016 The Apache Software Foundation. All rights reserved.