Package org.apache.hadoop.hbase.ipc
Class RpcConnection
java.lang.Object
org.apache.hadoop.hbase.ipc.RpcConnection
- Direct Known Subclasses:
BlockingRpcConnection
,NettyRpcConnection
Base class for ipc connection.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final CellBlockBuilder
protected final Codec
protected final org.apache.hadoop.io.compress.CompressionCodec
protected final org.apache.hadoop.conf.Configuration
protected static boolean
protected static String
private String
protected long
private static final org.slf4j.Logger
protected final MetricsConnection
protected SaslClientAuthenticationProvider
protected final int
protected final ConnectionId
protected final SecurityInfo
protected final org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimer
protected final org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier>
protected final boolean
-
Constructor Summary
ModifierConstructorDescriptionprotected
RpcConnection
(org.apache.hadoop.conf.Configuration conf, org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimer timeoutTimer, ConnectionId remoteId, String clusterId, boolean isSecurityEnabled, Codec codec, org.apache.hadoop.io.compress.CompressionCodec compressor, CellBlockBuilder cellBlockBuilder, MetricsConnection metrics, Map<String, byte[]> connectionAttributes) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
callTimeout
(Call call) protected final String
chooseServerPrincipal
(Set<String> candidates, Call securityPreambleCall) abstract void
Does the clean up work after the connection is removed from the connection poolprotected final Call
createSecurityPreambleCall
(org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<Call> callback) private <T extends InputStream & DataInput>
voidfinishCall
(org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.ResponseHeader responseHeader, T in, Call call) protected final org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.ConnectionHeader
protected byte[]
private static String
getHostnameForServerPrincipal
(org.apache.hadoop.conf.Configuration conf, InetAddress addr) long
protected final InetSocketAddress
getRemoteInetAddress
(MetricsConnection metrics) private static String
getServerPrincipal
(org.apache.hadoop.conf.Configuration conf, String serverKey, InetAddress server) abstract boolean
isActive()
Tell the idle connection sweeper whether we could be swept.protected final boolean
protected final <T> T
randomSelect
(Collection<T> c) (package private) <T extends InputStream & DataInput>
voidreadResponse
(T in, Map<Integer, Call> id2Call, Call preambleCall, Consumer<org.apache.hadoop.ipc.RemoteException> fatalConnectionErrorConsumer) remoteId()
protected final void
saslNegotiationDone
(String serverPrincipal, boolean succeed) protected final void
scheduleTimeoutTask
(Call call) abstract void
sendRequest
(Call call, HBaseRpcController hrc) void
setLastTouched
(long lastTouched) abstract void
shutdown()
Just close connection.private static boolean
useCanonicalHostname
(org.apache.hadoop.conf.Configuration conf)
-
Field Details
-
LOG
-
remoteId
-
useSasl
-
token
protected final org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token -
securityInfo
-
reloginMaxBackoff
-
codec
-
compressor
-
cellBlockBuilder
-
metrics
-
connectionAttributes
-
timeoutTimer
-
conf
-
CRYPTO_AES_ENABLED_KEY
-
CRYPTO_AES_ENABLED_DEFAULT
-
lastTouched
-
provider
-
lastSucceededServerPrincipal
-
-
Constructor Details
-
RpcConnection
protected RpcConnection(org.apache.hadoop.conf.Configuration conf, org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimer timeoutTimer, ConnectionId remoteId, String clusterId, boolean isSecurityEnabled, Codec codec, org.apache.hadoop.io.compress.CompressionCodec compressor, CellBlockBuilder cellBlockBuilder, MetricsConnection metrics, Map<String, byte[]> connectionAttributes) throws IOException- Throws:
IOException
-
-
Method Details
-
scheduleTimeoutTask
-
getConnectionHeaderPreamble
-
getConnectionHeader
protected final org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.ConnectionHeader getConnectionHeader() -
getRemoteInetAddress
protected final InetSocketAddress getRemoteInetAddress(MetricsConnection metrics) throws UnknownHostException - Throws:
UnknownHostException
-
useCanonicalHostname
-
getHostnameForServerPrincipal
private static String getHostnameForServerPrincipal(org.apache.hadoop.conf.Configuration conf, InetAddress addr) -
getServerPrincipal
private static String getServerPrincipal(org.apache.hadoop.conf.Configuration conf, String serverKey, InetAddress server) throws IOException - Throws:
IOException
-
isKerberosAuth
-
getServerPrincipals
- Throws:
IOException
-
randomSelect
-
chooseServerPrincipal
protected final String chooseServerPrincipal(Set<String> candidates, Call securityPreambleCall) throws SaslException - Throws:
SaslException
-
saslNegotiationDone
-
callTimeout
-
remoteId
-
getLastTouched
-
setLastTouched
-
isActive
Tell the idle connection sweeper whether we could be swept. -
shutdown
Just close connection. Do not need to remove from connection pool. -
sendRequest
- Throws:
IOException
-
cleanupConnection
Does the clean up work after the connection is removed from the connection pool -
createSecurityPreambleCall
protected final Call createSecurityPreambleCall(org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<Call> callback) -
finishCall
private <T extends InputStream & DataInput> void finishCall(org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.ResponseHeader responseHeader, T in, Call call) throws IOException - Throws:
IOException
-
readResponse
<T extends InputStream & DataInput> void readResponse(T in, Map<Integer, Call> id2Call, Call preambleCall, Consumer<org.apache.hadoop.ipc.RemoteException> fatalConnectionErrorConsumer) throws IOException- Throws:
IOException
-