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
FieldsModifier and TypeFieldDescriptionprotected final CellBlockBuilderprotected final Codecprotected final org.apache.hadoop.io.compress.CompressionCodecprotected final org.apache.hadoop.conf.Configurationprotected static booleanprotected static Stringprivate Stringprotected longprivate static final org.slf4j.Loggerprotected final MetricsConnectionprotected SaslClientAuthenticationProviderprotected final intprotected final ConnectionIdprotected final SecurityInfoprotected final org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimerprotected final org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier>protected final boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRpcConnection(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 voidcallTimeout(Call call) protected final StringchooseServerPrincipal(Set<String> candidates, Call securityPreambleCall) abstract voidDoes the clean up work after the connection is removed from the connection poolprotected final CallcreateSecurityPreambleCall(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.ConnectionHeaderprotected byte[]private static StringgetHostnameForServerPrincipal(org.apache.hadoop.conf.Configuration conf, InetAddress addr) longprotected final InetSocketAddressgetRemoteInetAddress(MetricsConnection metrics) private static StringgetServerPrincipal(org.apache.hadoop.conf.Configuration conf, String serverKey, InetAddress server) abstract booleanisActive()Tell the idle connection sweeper whether we could be swept.protected final booleanprotected final <T> TrandomSelect(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 voidsaslNegotiationDone(String serverPrincipal, boolean succeed) protected final voidscheduleTimeoutTask(Call call) abstract voidsendRequest(Call call, HBaseRpcController hrc) voidsetLastTouched(long lastTouched) abstract voidshutdown()Just close connection.private static booleanuseCanonicalHostname(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
-