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
FieldsModifier and TypeFieldDescriptionprivate org.apache.hbase.thirdparty.io.netty.channel.Channelprivate org.apache.hbase.thirdparty.io.netty.buffer.ByteBufprivate org.apache.hbase.thirdparty.io.netty.buffer.ByteBufprivate final org.apache.hbase.thirdparty.io.netty.channel.EventLoopprivate static final org.slf4j.Loggerprivate static final ScheduledExecutorServiceprivate booleanprivate final NettyRpcClientFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcallTimeout(Call call) voidDoes the clean up work after the connection is removed from the connection poolprivate voidprivate voidestablished(org.apache.hbase.thirdparty.io.netty.channel.Channel ch) private voidfailInit(org.apache.hbase.thirdparty.io.netty.channel.Channel ch, IOException e) private voidgetConnectionRegistry(org.apache.hbase.thirdparty.io.netty.channel.Channel ch, Call connectionRegistryCall) booleanisActive()Tell the idle connection sweeper whether we could be swept.private voidonSecurityPreambleError(org.apache.hbase.thirdparty.io.netty.channel.Channel ch, Set<String> serverPrincipals, IOException error) private voidonSecurityPreambleFinish(org.apache.hbase.thirdparty.io.netty.channel.Channel ch, Set<String> serverPrincipals, Call securityPreambleCall) private voidsaslEstablished(org.apache.hbase.thirdparty.io.netty.channel.Channel ch, String serverPrincipal) private voidsaslFailInit(org.apache.hbase.thirdparty.io.netty.channel.Channel ch, String serverPrincipal, IOException error) private voidsaslNegotiate(org.apache.hbase.thirdparty.io.netty.channel.Channel ch) private voidsaslNegotiate(org.apache.hbase.thirdparty.io.netty.channel.Channel ch, String serverPrincipal) private voidscheduleRelogin(Throwable error) voidsendRequest(Call call, HBaseRpcController hrc) private voidsendRequest0(Call call, HBaseRpcController hrc) voidshutdown()Just close connection.private voidMethods 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:
callTimeoutin classRpcConnection
-
isActive
Description copied from class:RpcConnectionTell the idle connection sweeper whether we could be swept.- Specified by:
isActivein classRpcConnection
-
shutdown0
-
shutdown
Description copied from class:RpcConnectionJust close connection. Do not need to remove from connection pool.- Specified by:
shutdownin classRpcConnection
-
cleanupConnection
Description copied from class:RpcConnectionDoes the clean up work after the connection is removed from the connection pool- Specified by:
cleanupConnectionin 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:
sendRequestin classRpcConnection
-