Package org.apache.hadoop.hbase.ipc
Class NettyRpcConnection
java.lang.Object
org.apache.hadoop.hbase.ipc.RpcConnection
org.apache.hadoop.hbase.ipc.NettyRpcConnection
RPC connection implementation based on netty.
Most operations are executed in handlers. Netty handler is always executed in the same
thread(EventLoop) so no lock is needed.
Implementation assumptions: All the private methods should be called in the
eventLoop
thread, otherwise there will be races.- Since:
- 2.0.0
-
Field Summary
Modifier and TypeFieldDescriptionprivate org.apache.hbase.thirdparty.io.netty.channel.Channel
private org.apache.hbase.thirdparty.io.netty.buffer.ByteBuf
private org.apache.hbase.thirdparty.io.netty.buffer.ByteBuf
private final org.apache.hbase.thirdparty.io.netty.channel.EventLoop
private static final org.slf4j.Logger
private static final ScheduledExecutorService
private boolean
private final NettyRpcClient
Fields inherited from class org.apache.hadoop.hbase.ipc.RpcConnection
cellBlockBuilder, codec, compressor, conf, CRYPTO_AES_ENABLED_DEFAULT, CRYPTO_AES_ENABLED_KEY, lastTouched, metrics, provider, reloginMaxBackoff, remoteId, securityInfo, timeoutTimer, token, useSasl
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
callTimeout
(Call call) void
Does the clean up work after the connection is removed from the connection poolprivate void
private void
established
(org.apache.hbase.thirdparty.io.netty.channel.Channel ch) private void
failInit
(org.apache.hbase.thirdparty.io.netty.channel.Channel ch, IOException e) private void
getConnectionRegistry
(org.apache.hbase.thirdparty.io.netty.channel.Channel ch, Call connectionRegistryCall) boolean
isActive()
Tell the idle connection sweeper whether we could be swept.private void
onSecurityPreambleError
(org.apache.hbase.thirdparty.io.netty.channel.Channel ch, Set<String> serverPrincipals, IOException error) private void
onSecurityPreambleFinish
(org.apache.hbase.thirdparty.io.netty.channel.Channel ch, Set<String> serverPrincipals, Call securityPreambleCall) private void
saslEstablished
(org.apache.hbase.thirdparty.io.netty.channel.Channel ch, String serverPrincipal) private void
saslFailInit
(org.apache.hbase.thirdparty.io.netty.channel.Channel ch, String serverPrincipal, IOException error) private void
saslNegotiate
(org.apache.hbase.thirdparty.io.netty.channel.Channel ch) private void
saslNegotiate
(org.apache.hbase.thirdparty.io.netty.channel.Channel ch, String serverPrincipal) private void
scheduleRelogin
(Throwable error) void
sendRequest
(Call call, HBaseRpcController hrc) private void
sendRequest0
(Call call, HBaseRpcController hrc) void
shutdown()
Just close connection.private void
Methods inherited from class org.apache.hadoop.hbase.ipc.RpcConnection
chooseServerPrincipal, createSecurityPreambleCall, getConnectionHeader, getConnectionHeaderPreamble, getLastTouched, getRemoteInetAddress, getServerPrincipals, isKerberosAuth, randomSelect, readResponse, remoteId, saslNegotiationDone, scheduleTimeoutTask, setLastTouched
-
Field Details
-
LOG
-
RELOGIN_EXECUTOR
-
rpcClient
-
eventLoop
-
connectionHeaderPreamble
-
connectionHeaderWithLength
-
channel
-
reloginInProgress
-
-
Constructor Details
-
NettyRpcConnection
NettyRpcConnection(NettyRpcClient rpcClient, ConnectionId remoteId) throws IOException - Throws:
IOException
-
-
Method Details
-
callTimeout
- Specified by:
callTimeout
in classRpcConnection
-
isActive
Description copied from class:RpcConnection
Tell the idle connection sweeper whether we could be swept.- Specified by:
isActive
in classRpcConnection
-
shutdown0
-
shutdown
Description copied from class:RpcConnection
Just close connection. Do not need to remove from connection pool.- Specified by:
shutdown
in classRpcConnection
-
cleanupConnection
Description copied from class:RpcConnection
Does the clean up work after the connection is removed from the connection pool- Specified by:
cleanupConnection
in classRpcConnection
-
established
-
saslEstablished
private void saslEstablished(org.apache.hbase.thirdparty.io.netty.channel.Channel ch, String serverPrincipal) -
scheduleRelogin
-
failInit
-
saslFailInit
private void saslFailInit(org.apache.hbase.thirdparty.io.netty.channel.Channel ch, String serverPrincipal, IOException error) -
saslNegotiate
private void saslNegotiate(org.apache.hbase.thirdparty.io.netty.channel.Channel ch, String serverPrincipal) -
getConnectionRegistry
private void getConnectionRegistry(org.apache.hbase.thirdparty.io.netty.channel.Channel ch, Call connectionRegistryCall) -
onSecurityPreambleError
private void onSecurityPreambleError(org.apache.hbase.thirdparty.io.netty.channel.Channel ch, Set<String> serverPrincipals, IOException error) -
onSecurityPreambleFinish
private void onSecurityPreambleFinish(org.apache.hbase.thirdparty.io.netty.channel.Channel ch, Set<String> serverPrincipals, Call securityPreambleCall) -
saslNegotiate
private void saslNegotiate(org.apache.hbase.thirdparty.io.netty.channel.Channel ch) throws IOException - Throws:
IOException
-
connect
- Throws:
UnknownHostException
-
sendRequest0
- Throws:
IOException
-
sendRequest
- Specified by:
sendRequest
in classRpcConnection
-