@InterfaceAudience.Private public abstract class RegionAdminServiceCallable<T> extends Object implements RetryingCallable<T>
Modifier and Type | Field and Description |
---|---|
protected ClusterConnection |
connection |
private HBaseRpcController |
controller |
protected HRegionLocation |
location |
protected int |
replicaId |
protected byte[] |
row |
protected RpcControllerFactory |
rpcControllerFactory |
protected org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface |
stub |
protected TableName |
tableName |
Constructor and Description |
---|
RegionAdminServiceCallable(ClusterConnection connection,
RpcControllerFactory rpcControllerFactory,
HRegionLocation location,
TableName tableName,
byte[] row) |
RegionAdminServiceCallable(ClusterConnection connection,
RpcControllerFactory rpcControllerFactory,
HRegionLocation location,
TableName tableName,
byte[] row,
int replicaId) |
RegionAdminServiceCallable(ClusterConnection connection,
RpcControllerFactory rpcControllerFactory,
TableName tableName,
byte[] row) |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
call(HBaseRpcController rpcController)
Run RPC call.
|
T |
call(int callTimeout)
Override that changes Exception from
Exception to IOException . |
(package private) Connection |
getConnection() |
(package private) HBaseRpcController |
getCurrentPayloadCarryingRpcController() |
protected String |
getExceptionMessage() |
String |
getExceptionMessageAdditionalDetail() |
HRegionLocation |
getLocation(boolean useCache) |
static RegionLocations |
getRegionLocations(ClusterConnection connection,
TableName tableName,
byte[] row,
boolean useCache,
int replicaId) |
void |
prepare(boolean reload)
Prepare by setting up any connections to servers, etc., ahead of call invocation.
|
protected void |
setStub(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface stub) |
long |
sleep(long pause,
int tries) |
void |
throwable(Throwable t,
boolean retrying)
Called when call throws an exception and we are going to retry; take action to
make it so we succeed on next call (clear caches, do relookup of locations, etc.).
|
protected org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface stub
protected final RpcControllerFactory rpcControllerFactory
private HBaseRpcController controller
protected final ClusterConnection connection
protected HRegionLocation location
protected final byte[] row
protected final int replicaId
public RegionAdminServiceCallable(ClusterConnection connection, RpcControllerFactory rpcControllerFactory, TableName tableName, byte[] row)
public RegionAdminServiceCallable(ClusterConnection connection, RpcControllerFactory rpcControllerFactory, HRegionLocation location, TableName tableName, byte[] row)
public RegionAdminServiceCallable(ClusterConnection connection, RpcControllerFactory rpcControllerFactory, HRegionLocation location, TableName tableName, byte[] row, int replicaId)
public void prepare(boolean reload) throws IOException
RetryingCallable
prepare
in interface RetryingCallable<T>
reload
- Set this to true if need to requery locationsIOException
- eprotected void setStub(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface stub)
public HRegionLocation getLocation(boolean useCache) throws IOException
IOException
public void throwable(Throwable t, boolean retrying)
RetryingCallable
throwable
in interface RetryingCallable<T>
t
- throwable which was thrownretrying
- True if we are in retrying mode (we are not in retrying mode when max
retries == 1; we ARE in retrying mode if retries > 1 even when we are the
last attempt)Connection getConnection()
Connection
instance used by this Callable.protected String getExceptionMessage()
public String getExceptionMessageAdditionalDetail()
getExceptionMessageAdditionalDetail
in interface RetryingCallable<T>
public long sleep(long pause, int tries)
sleep
in interface RetryingCallable<T>
pause
- time to pausetries
- amount of tries until till sleeppublic static RegionLocations getRegionLocations(ClusterConnection connection, TableName tableName, byte[] row, boolean useCache, int replicaId) throws RetriesExhaustedException, DoNotRetryIOException, InterruptedIOException
public T call(int callTimeout) throws IOException
Exception
to IOException
. It also does
setup of an rpcController and calls through to the unimplemented
call(PayloadCarryingRpcController) method; implement this method to add your rpc invocation.call
in interface RetryingCallable<T>
callTimeout
- - the time available for this call. 0 for infinite.IOException
HBaseRpcController getCurrentPayloadCarryingRpcController()
protected abstract T call(HBaseRpcController rpcController) throws Exception
rpcController
- PayloadCarryingRpcController is a mouthful but it at a minimum is a
facade on protobuf so we don't have to put protobuf everywhere; we can keep it behind this
class.Exception
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.