Package org.apache.hadoop.hbase.ipc
Class NettyRpcServer
java.lang.Object
org.apache.hadoop.hbase.ipc.RpcServer
org.apache.hadoop.hbase.ipc.NettyRpcServer
- All Implemented Interfaces:
ConfigurationObserver,RpcServerInterface
An RPC server with Netty4 implementation.
- Since:
- 2.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.ipc.RpcServer
RpcServer.BlockingServiceAndInterface, RpcServer.CallCleanup -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final org.apache.hbase.thirdparty.io.netty.channel.group.ChannelGroupprivate final InetSocketAddressprivate static final intstatic final StringFatal watermark for pending outbound bytes of a single netty channel.private static final intstatic final StringHigh watermark for pending outbound bytes of a single netty channel.private static final intstatic final StringLow watermark for pending outbound bytes of a single netty channel.private final org.apache.hbase.thirdparty.io.netty.buffer.ByteBufAllocatorprivate final CountDownLatchstatic final StringName of property to change the byte buf allocator for the netty channels.(package private) static final Stringprivate final AtomicReference<FileChangeWatcher>static final org.slf4j.Logger(package private) static final Stringprivate final org.apache.hbase.thirdparty.io.netty.channel.Channelprivate final AtomicReference<org.apache.hbase.thirdparty.io.netty.handler.ssl.SslContext>private final AtomicReference<FileChangeWatcher>(package private) static final Stringprivate intprivate org.apache.hbase.thirdparty.io.netty.channel.WriteBufferWaterMarkFields inherited from class org.apache.hadoop.hbase.ipc.RpcServer
allowFallbackToSimpleAuth, AUDITLOG, AUTH_FAILED_FOR, AUTH_SUCCESSFUL_FOR, authManager, authTokenSecretMgr, bbAllocator, CALL_QUEUE_TOO_BIG_EXCEPTION, callQueueSizeInBytes, cellBlockBuilder, conf, CurCall, CURRENT_VERSION, DEFAULT_MAX_CALLQUEUE_LENGTH_PER_HANDLER, DEFAULT_MAX_CALLQUEUE_SIZE, DEFAULT_MAX_REQUEST_SIZE, DEFAULT_MIN_CLIENT_REQUEST_TIMEOUT, DEFAULT_TRACE_LOG_MAX_LENGTH, DEFAULT_WARN_RESPONSE_SIZE, DEFAULT_WARN_RESPONSE_TIME, errorHandler, FALLBACK_TO_INSECURE_CLIENT_AUTH, GSON, isSecurityEnabled, KEY_WORD_TRUNCATED, MAX_REQUEST_SIZE, maxQueueSizeInBytes, maxRequestSize, metrics, MIN_CLIENT_REQUEST_TIMEOUT, minClientRequestTimeout, MONITORED_RPC, NIO_BUFFER_LIMIT, running, saslProps, scheduler, secretManager, server, serverPrincipal, services, started, tcpKeepAlive, tcpNoDelay, TRACE_LOG_MAX_LENGTH, userProvider, WARN_RESPONSE_SIZE, WARN_RESPONSE_TIME, WARN_SCAN_RESPONSE_SIZE, WARN_SCAN_RESPONSE_TIME, warnResponseSize, warnResponseTime, warnScanResponseSize, warnScanResponseTime -
Constructor Summary
ConstructorsConstructorDescriptionNettyRpcServer(Server server, String name, List<RpcServer.BlockingServiceAndInterface> services, InetSocketAddress bindAddress, org.apache.hadoop.conf.Configuration conf, RpcScheduler scheduler, boolean reservoirEnabled) -
Method Summary
Modifier and TypeMethodDescriptionPair<org.apache.hbase.thirdparty.com.google.protobuf.Message,CellScanner> call(org.apache.hbase.thirdparty.com.google.protobuf.BlockingService service, org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor md, org.apache.hbase.thirdparty.com.google.protobuf.Message param, CellScanner cellScanner, long receiveTime, MonitoredRPCHandler status) Pair<org.apache.hbase.thirdparty.com.google.protobuf.Message,CellScanner> call(org.apache.hbase.thirdparty.com.google.protobuf.BlockingService service, org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor md, org.apache.hbase.thirdparty.com.google.protobuf.Message param, CellScanner cellScanner, long receiveTime, MonitoredRPCHandler status, long startTime, int timeout) private voidconfigureNettyWatermarks(org.apache.hadoop.conf.Configuration conf) protected NettyServerRpcConnectioncreateNettyServerRpcConnection(org.apache.hbase.thirdparty.io.netty.channel.Channel channel) private org.apache.hbase.thirdparty.io.netty.buffer.ByteBufAllocatorgetChannelAllocator(org.apache.hadoop.conf.Configuration conf) intThe number of open RPC conections(package private) org.apache.hbase.thirdparty.io.netty.handler.ssl.SslContextintprivate voidinitSSL(org.apache.hbase.thirdparty.io.netty.channel.ChannelPipeline p, NettyServerRpcConnection conn, boolean supportPlaintext) booleanvoidjoin()voidonConfigurationChange(org.apache.hadoop.conf.Configuration newConf) This method would be called by theConfigurationManagerobject when theConfigurationobject is reloaded from disk.voidsetSocketSendBufSize(int size) (package private) static voidsslHandshakeCompleteHandler(NettyServerRpcConnection conn, org.apache.hbase.thirdparty.io.netty.handler.ssl.SslHandler sslHandler, SocketAddress remoteAddress) voidstart()voidstop()Methods inherited from class org.apache.hadoop.hbase.ipc.RpcServer
addCallSize, authorize, call, channelRead, createSecretManager, getByteBuffAllocator, getConf, getCurrentCall, getErrorHandler, getMetrics, getRemoteAddress, getRemoteIp, getRequestUser, getRequestUserName, getScheduler, getSecretManager, getService, getServiceAndInterface, getServiceInterface, getServices, getStatus, initReconfigurable, isInRpcCallContext, isStarted, logResponse, needAuthorization, refreshAuthManager, setCurrentCall, setErrorHandler, setNamedQueueRecorder, setRsRpcServices, setSecretManager, truncateTraceLog, unsetCurrentCall
-
Field Details
-
LOG
-
HBASE_NETTY_ALLOCATOR_KEY
Name of property to change the byte buf allocator for the netty channels. Default is no value, which causes us to use PooledByteBufAllocator. Valid settings here are "pooled", "unpooled", and "heap", or, the name of a class implementing ByteBufAllocator."pooled" and "unpooled" may prefer direct memory depending on netty configuration, which is controlled by platform specific code and documented system properties.
"heap" will prefer heap arena allocations.
- See Also:
-
POOLED_ALLOCATOR_TYPE
- See Also:
-
UNPOOLED_ALLOCATOR_TYPE
- See Also:
-
HEAP_ALLOCATOR_TYPE
- See Also:
-
CHANNEL_WRITABLE_LOW_WATERMARK_KEY
Low watermark for pending outbound bytes of a single netty channel. If the high watermark was exceeded, channel will have setAutoRead to true again. The server will start reading incoming bytes (requests) from the client channel.- See Also:
-
CHANNEL_WRITABLE_LOW_WATERMARK_DEFAULT
- See Also:
-
CHANNEL_WRITABLE_HIGH_WATERMARK_KEY
High watermark for pending outbound bytes of a single netty channel. If the number of pending outbound bytes exceeds this threshold, setAutoRead will be false for the channel. The server will stop reading incoming requests from the client channel.Note: any requests already in the call queue will still be processed.
- See Also:
-
CHANNEL_WRITABLE_HIGH_WATERMARK_DEFAULT
- See Also:
-
CHANNEL_WRITABLE_FATAL_WATERMARK_KEY
Fatal watermark for pending outbound bytes of a single netty channel. If the number of pending outbound bytes exceeds this threshold, the connection will be forcibly closed so that memory can be reclaimed. The client will have to re-establish a new connection and retry any in-flight requests.Note: must be higher than the high watermark, otherwise it's ignored.
- See Also:
-
CHANNEL_WRITABLE_FATAL_WATERMARK_DEFAULT
- See Also:
-
bindAddress
-
closed
-
serverChannel
-
allChannels
-
channelAllocator
-
sslContextForServer
private final AtomicReference<org.apache.hbase.thirdparty.io.netty.handler.ssl.SslContext> sslContextForServer -
keyStoreWatcher
-
trustStoreWatcher
-
writeBufferFatalThreshold
-
writeBufferWaterMark
private volatile org.apache.hbase.thirdparty.io.netty.channel.WriteBufferWaterMark writeBufferWaterMark
-
-
Constructor Details
-
NettyRpcServer
public NettyRpcServer(Server server, String name, List<RpcServer.BlockingServiceAndInterface> services, InetSocketAddress bindAddress, org.apache.hadoop.conf.Configuration conf, RpcScheduler scheduler, boolean reservoirEnabled) throws IOException - Throws:
IOException
-
-
Method Details
-
onConfigurationChange
Description copied from interface:ConfigurationObserverThis method would be called by theConfigurationManagerobject when theConfigurationobject is reloaded from disk.- Specified by:
onConfigurationChangein interfaceConfigurationObserver- Overrides:
onConfigurationChangein classRpcServer
-
configureNettyWatermarks
-
isWritabilityBackpressureEnabled
-
getChannelAllocator
private org.apache.hbase.thirdparty.io.netty.buffer.ByteBufAllocator getChannelAllocator(org.apache.hadoop.conf.Configuration conf) throws IOException - Throws:
IOException
-
createNettyServerRpcConnection
@Private protected NettyServerRpcConnection createNettyServerRpcConnection(org.apache.hbase.thirdparty.io.netty.channel.Channel channel) -
start
-
stop
-
join
- Throws:
InterruptedException
-
getListenerAddress
-
setSocketSendBufSize
-
getNumOpenConnections
Description copied from class:RpcServerThe number of open RPC conections- Specified by:
getNumOpenConnectionsin classRpcServer- Returns:
- the number of open rpc connections
-
call
public Pair<org.apache.hbase.thirdparty.com.google.protobuf.Message,CellScanner> call(org.apache.hbase.thirdparty.com.google.protobuf.BlockingService service, org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor md, org.apache.hbase.thirdparty.com.google.protobuf.Message param, CellScanner cellScanner, long receiveTime, MonitoredRPCHandler status) throws IOException - Throws:
IOException
-
call
public Pair<org.apache.hbase.thirdparty.com.google.protobuf.Message,CellScanner> call(org.apache.hbase.thirdparty.com.google.protobuf.BlockingService service, org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor md, org.apache.hbase.thirdparty.com.google.protobuf.Message param, CellScanner cellScanner, long receiveTime, MonitoredRPCHandler status, long startTime, int timeout) throws IOException - Throws:
IOException
-
initSSL
private void initSSL(org.apache.hbase.thirdparty.io.netty.channel.ChannelPipeline p, NettyServerRpcConnection conn, boolean supportPlaintext) throws X509Exception, IOException - Throws:
X509ExceptionIOException
-
sslHandshakeCompleteHandler
static void sslHandshakeCompleteHandler(NettyServerRpcConnection conn, org.apache.hbase.thirdparty.io.netty.handler.ssl.SslHandler sslHandler, SocketAddress remoteAddress) -
getSslContext
org.apache.hbase.thirdparty.io.netty.handler.ssl.SslContext getSslContext() throws X509Exception, IOException- Throws:
X509ExceptionIOException
-
getWriteBufferFatalThreshold
-
getTotalAndMaxNettyOutboundBytes
-