@Deprecated @InterfaceAudience.LimitedPrivate(value="Configuration") public class SimpleRpcServer extends RpcServer
Scheduler can be variously implemented but default simple scheduler has handlers to which it has given the queues into which calls (i.e. CallRunner instances) are inserted. Handlers run taking from the queue. They run the CallRunner#run method on each item gotten from queue and keep taking while the server is up. CallRunner#run executes the call. When done, asks the included Call to put itself on new queue for Responder to pull from and return result to client.
BlockingRpcClient
Modifier and Type | Class and Description |
---|---|
private class |
SimpleRpcServer.ConnectionManager
Deprecated.
|
private class |
SimpleRpcServer.Listener
Deprecated.
Listens on the socket.
|
RpcServer.BlockingServiceAndInterface, RpcServer.CallCleanup
Modifier and Type | Field and Description |
---|---|
protected InetSocketAddress |
address
Deprecated.
|
private SimpleRpcServer.ConnectionManager |
connectionManager
Deprecated.
|
private SimpleRpcServer.Listener |
listener
Deprecated.
|
protected int |
port
Deprecated.
|
protected long |
purgeTimeout
Deprecated.
|
private int |
readThreads
Deprecated.
|
protected SimpleRpcServerResponder |
responder
Deprecated.
|
protected int |
socketSendBufferSize
Deprecated.
|
allowFallbackToSimpleAuth, AUDITLOG, AUTH_FAILED_FOR, AUTH_SUCCESSFUL_FOR, authManager, authTokenSecretMgr, bbAllocator, bindAddress, 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, LOG, MAX_REQUEST_SIZE, maxQueueSizeInBytes, maxRequestSize, metrics, MIN_CLIENT_REQUEST_TIMEOUT, minClientRequestTimeout, MONITORED_RPC, NIO_BUFFER_LIMIT, running, saslProps, scheduler, secretManager, server, services, started, tcpKeepAlive, tcpNoDelay, TRACE_LOG_MAX_LENGTH, userProvider, WARN_RESPONSE_SIZE, WARN_RESPONSE_TIME, warnResponseSize, warnResponseTime
Constructor and Description |
---|
SimpleRpcServer(Server server,
String name,
List<RpcServer.BlockingServiceAndInterface> services,
InetSocketAddress bindAddress,
org.apache.hadoop.conf.Configuration conf,
RpcScheduler scheduler,
boolean reservoirEnabled)
Deprecated.
Constructs a server listening on the named port and address.
|
Modifier and Type | Method and Description |
---|---|
static void |
bind(ServerSocket socket,
InetSocketAddress address,
int backlog)
Deprecated.
A convenience method to bind to a given address and report better exceptions if the address is
not a valid host.
|
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)
Deprecated.
|
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)
Deprecated.
|
protected long |
channelWrite(GatheringByteChannel channel,
BufferChain bufferChain)
Deprecated.
|
protected void |
closeConnection(SimpleServerRpcConnection connection)
Deprecated.
|
protected SimpleServerRpcConnection |
getConnection(SocketChannel channel,
long time)
Deprecated.
Subclasses of HBaseServer can override this to provide their own Connection implementations.
|
InetSocketAddress |
getListenerAddress()
Deprecated.
Return the socket (ip+port) on which the RPC server is listening to.
|
int |
getNumOpenConnections()
Deprecated.
The number of open RPC conections
|
void |
join()
Deprecated.
Wait for the server to be stopped.
|
void |
setSocketSendBufSize(int size)
Deprecated.
Sets the socket buffer size used for responding to RPCs.
|
void |
start()
Deprecated.
Starts the service.
|
void |
stop()
Deprecated.
Stops the service.
|
addCallSize, authorize, call, channelRead, createSecretManager, getByteBuffAllocator, getConf, getCurrentCall, getErrorHandler, getMetrics, getRemoteAddress, getRemoteIp, getRequestUser, getRequestUserName, getScheduler, getSecretManager, getService, getServiceAndInterface, getServiceInterface, getStatus, initReconfigurable, isInRpcCallContext, isStarted, logResponse, needAuthorization, onConfigurationChange, refreshAuthManager, setCurrentCall, setErrorHandler, setNamedQueueRecorder, setRsRpcServices, setSecretManager, truncateTraceLog, unsetCurrentCall
protected int port
protected InetSocketAddress address
private int readThreads
protected int socketSendBufferSize
protected final long purgeTimeout
private SimpleRpcServer.ConnectionManager connectionManager
private SimpleRpcServer.Listener listener
protected SimpleRpcServerResponder responder
public SimpleRpcServer(Server server, String name, List<RpcServer.BlockingServiceAndInterface> services, InetSocketAddress bindAddress, org.apache.hadoop.conf.Configuration conf, RpcScheduler scheduler, boolean reservoirEnabled) throws IOException
server
- hosting instance of Server
. We will do authentications if an
instance else pass null for no authentication check.name
- Used keying this rpc servers' metrics and for naming the Listener thread.services
- A list of services.bindAddress
- Where to listen nn * @param reservoirEnabled Enable ByteBufferPool or not.IOException
protected SimpleServerRpcConnection getConnection(SocketChannel channel, long time)
protected void closeConnection(SimpleServerRpcConnection connection)
public void setSocketSendBufSize(int size)
size
- send sizepublic void start()
public void stop()
public void join() throws InterruptedException
InterruptedException
stop()
public InetSocketAddress getListenerAddress()
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
IOException
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
IOException
protected long channelWrite(GatheringByteChannel channel, BufferChain bufferChain) throws IOException
IOException
public static void bind(ServerSocket socket, InetSocketAddress address, int backlog) throws IOException
socket
- the socket to bindaddress
- the address to bind tobacklog
- the number of connections allowed in the queueBindException
- if the address can't be boundUnknownHostException
- if the address isn't a valid host nameIOException
- other random errors from bindpublic int getNumOpenConnections()
getNumOpenConnections
in class RpcServer
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.