public class AsyncRpcClient
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
org.apache.hadoop.hbase.codec.Codec |
codec |
org.apache.hadoop.io.compress.CompressionCodec |
compressor |
protected org.apache.hadoop.conf.Configuration |
configuration |
org.apache.hadoop.hbase.ipc.IPCUtil |
ipcUtil |
static org.apache.commons.logging.Log |
LOG |
static io.netty.util.HashedWheelTimer |
WHEEL_TIMER |
| Constructor and Description |
|---|
AsyncRpcClient(org.apache.hadoop.hbase.client.HConnection connection,
java.lang.String clusterId,
java.net.SocketAddress localAddress)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
java.nio.ByteBuffer |
buildCellBlock(org.apache.hadoop.hbase.CellScanner cells)
Build cell block
|
void |
cancelConnections(java.lang.String hostname,
int port,
java.io.IOException ioe)
Interrupt the connections to the given ip:port server.
|
void |
close()
Close netty
|
org.apache.hadoop.hbase.CellScanner |
createCellScanner(byte[] cellBlock)
Create a cell scanner
|
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.Interface |
getClientService(org.apache.hadoop.hbase.HRegionLocation location)
Get the client service
|
org.apache.hadoop.conf.Configuration |
getConfiguration()
Get hbase configuration
|
AsyncRpcChannel |
getConnection(com.google.protobuf.Descriptors.ServiceDescriptor serviceDescriptor,
org.apache.hadoop.hbase.HRegionLocation location)
Get a connection from the pool, or create a new one and add it to the
pool.
|
io.netty.util.concurrent.EventExecutor |
getEventLoop()
Get an event loop
|
org.apache.hadoop.hbase.client.HConnection |
getHConnection()
Get the HConnection
|
org.apache.hadoop.hbase.client.NonceGenerator |
getNonceGenerator()
Get nonce generator
|
org.apache.hadoop.hbase.HRegionLocation |
getRegionLocation(org.apache.hadoop.hbase.TableName table,
byte[] row,
boolean reload)
Get region location
|
<T> AsyncPayloadCarryingRpcController |
newRpcController(ResponseHandler<T> handler)
Return an new RPC controller
|
void |
removeConnection(org.apache.hadoop.hbase.ipc.RpcClient.ConnectionId remoteId)
Remove connection from pool
|
public static final org.apache.commons.logging.Log LOG
protected final org.apache.hadoop.conf.Configuration configuration
public final org.apache.hadoop.hbase.ipc.IPCUtil ipcUtil
public final org.apache.hadoop.hbase.codec.Codec codec
public final org.apache.hadoop.io.compress.CompressionCodec compressor
public static final io.netty.util.HashedWheelTimer WHEEL_TIMER
public AsyncRpcClient(org.apache.hadoop.hbase.client.HConnection connection,
java.lang.String clusterId,
java.net.SocketAddress localAddress)
connection - to HBaseclusterId - for the clusterlocalAddress - local address to connect topublic void close()
public io.netty.util.concurrent.EventExecutor getEventLoop()
public org.apache.hadoop.hbase.CellScanner createCellScanner(byte[] cellBlock)
throws java.io.IOException
cellBlock - to create scanner forjava.io.IOException - on error on creation cell scannerpublic java.nio.ByteBuffer buildCellBlock(org.apache.hadoop.hbase.CellScanner cells)
throws java.io.IOException
cells - to create block withjava.io.IOException - if block creation failspublic void cancelConnections(java.lang.String hostname,
int port,
java.io.IOException ioe)
hostname - to cancel connections forport - to cancel connection forioe - exception which canceled connectionpublic AsyncRpcChannel getConnection(com.google.protobuf.Descriptors.ServiceDescriptor serviceDescriptor, org.apache.hadoop.hbase.HRegionLocation location) throws java.io.IOException
serviceDescriptor - to get connection forlocation - to connect tojava.io.IOException - if connecting failspublic void removeConnection(org.apache.hadoop.hbase.ipc.RpcClient.ConnectionId remoteId)
remoteId - of connectionpublic org.apache.hadoop.conf.Configuration getConfiguration()
public org.apache.hadoop.hbase.HRegionLocation getRegionLocation(org.apache.hadoop.hbase.TableName table,
byte[] row,
boolean reload)
throws java.io.IOException
table - to get location ofrow - to get location ofreload - java.io.IOException - if connection fetching failspublic org.apache.hadoop.hbase.client.NonceGenerator getNonceGenerator()
public <T> AsyncPayloadCarryingRpcController newRpcController(ResponseHandler<T> handler)
T - Type of Result returnedhandler - for controller to run on errorspublic org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.Interface getClientService(org.apache.hadoop.hbase.HRegionLocation location)
throws java.io.IOException
location - to get service ofjava.io.IOException - if service creation failspublic org.apache.hadoop.hbase.client.HConnection getHConnection()