|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.ipc.HBaseServer
public abstract class HBaseServer
An abstract IPC service. IPC calls take a single Writable
as a
parameter, and return a Writable
as their value. A service runs on
a port and is defined by a parameter class and a value class.
Copied local so can fix HBASE-900.
HBaseClient
Field Summary | |
---|---|
static byte |
CURRENT_VERSION
|
static ByteBuffer |
HEADER
The first four bytes of Hadoop RPC connections |
static org.apache.commons.logging.Log |
LOG
|
protected HBaseRpcMetrics |
rpcMetrics
|
Constructor Summary | |
---|---|
protected |
HBaseServer(String bindAddress,
int port,
Class<? extends org.apache.hadoop.io.Writable> paramClass,
int handlerCount,
org.apache.hadoop.conf.Configuration conf)
|
protected |
HBaseServer(String bindAddress,
int port,
Class<? extends org.apache.hadoop.io.Writable> paramClass,
int handlerCount,
org.apache.hadoop.conf.Configuration conf,
String serverName)
Constructs a server listening on the named port and address. |
Method Summary | |
---|---|
static void |
bind(ServerSocket socket,
InetSocketAddress address,
int backlog)
A convenience method to bind to a given address and report better exceptions if the address is not a valid host. |
abstract org.apache.hadoop.io.Writable |
call(org.apache.hadoop.io.Writable param,
long receiveTime)
Called for each call. |
static HBaseServer |
get()
Returns the server instance called under or null. |
int |
getCallQueueLen()
The number of rpc calls in the queue. |
InetSocketAddress |
getListenerAddress()
Return the socket (ip+port) on which the RPC server is listening to. |
int |
getNumOpenConnections()
The number of open RPC conections |
static String |
getRemoteAddress()
Returns remote address as a string when invoked inside an RPC. |
static InetAddress |
getRemoteIp()
Returns the remote side ip address when invoked inside an RPC Returns null incase of an error. |
void |
join()
Wait for the server to be stopped. |
void |
setErrorHandler(HBaseRPCErrorHandler handler)
Set the handler for calling out of RPC for error conditions. |
void |
setSocketSendBufSize(int size)
Sets the socket buffer size used for responding to RPCs |
void |
start()
Starts the service. |
void |
stop()
Stops the service. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ByteBuffer HEADER
public static final byte CURRENT_VERSION
public static final org.apache.commons.logging.Log LOG
protected HBaseRpcMetrics rpcMetrics
Constructor Detail |
---|
protected HBaseServer(String bindAddress, int port, Class<? extends org.apache.hadoop.io.Writable> paramClass, int handlerCount, org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
protected HBaseServer(String bindAddress, int port, Class<? extends org.apache.hadoop.io.Writable> paramClass, int handlerCount, org.apache.hadoop.conf.Configuration conf, String serverName) throws IOException
handlerCount determines
the number of handler threads that will be used to process calls.
- Throws:
IOException
Method Detail |
---|
public static HBaseServer get()
call(Writable, long)
implementations, and under Writable
methods of paramters and return values. Permits applications to access
the server context.
public static InetAddress getRemoteIp()
public static String getRemoteAddress()
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 queue
BindException
- if the address can't be bound
UnknownHostException
- if the address isn't a valid host name
IOException
- other random errors from bindpublic void setSocketSendBufSize(int size)
public void start() throws IOException
IOException
public void stop()
public void join() throws InterruptedException
stop()
.
InterruptedException
public InetSocketAddress getListenerAddress()
public abstract org.apache.hadoop.io.Writable call(org.apache.hadoop.io.Writable param, long receiveTime) throws IOException
IOException
public int getNumOpenConnections()
public int getCallQueueLen()
public void setErrorHandler(HBaseRPCErrorHandler handler)
handler
- the handler implementation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |