T
- the class that the ServerCallable handles@InterfaceAudience.Private public abstract class NoncedRegionServerCallable<T> extends ClientServiceCallable<T>
RegionServerCallable.call(int)
to trigger the rpc. The
RegionServerCallable.call(int)
eventually invokes your #rpcCall(RpcController) meanwhile saving you having to
write a bunch of boilerplate. The RegionServerCallable.call(int)
implementation is from
RpcRetryingCaller
so rpcs are retried on fail.
TODO: this class is actually tied to one region, because most of the paths make use of the regioninfo part of location when building requests. The only reason it works for multi-region requests (e.g. batch) is that they happen to not use the region parts. This could be done cleaner (e.g. having a generic parameter and 2 derived classes, RegionCallable and actual RegionServerCallable with ServerName.
Modifier and Type | Field and Description |
---|---|
private long |
nonce |
location, rpcController, stub
Constructor and Description |
---|
NoncedRegionServerCallable(Connection connection,
TableName tableName,
byte[] row,
HBaseRpcController rpcController,
int priority) |
Modifier and Type | Method and Description |
---|---|
(package private) long |
getNonce() |
(package private) long |
getNonceGroup() |
doGet, doMutate, setStubByServiceName
call, getConnection, getExceptionMessageAdditionalDetail, getHRegionInfo, getLocation, getPriority, getRow, getRpcController, getRpcControllerCellScanner, getStub, getTableName, prepare, rpcCall, setLocation, setRpcControllerCellScanner, setStub, sleep, throwable
private final long nonce
public NoncedRegionServerCallable(Connection connection, TableName tableName, byte[] row, HBaseRpcController rpcController, int priority)
connection
- Connection to use.tableName
- Table name to which row
belongs.row
- The row we want in tableName
.long getNonceGroup()
long getNonce()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.