Package org.apache.hadoop.hbase.client
Class RegionAdminServiceCallable<T>
java.lang.Object
org.apache.hadoop.hbase.client.RegionAdminServiceCallable<T>
- All Implemented Interfaces:
RetryingCallable<T>
- Direct Known Subclasses:
FlushRegionCallable
,RegionReplicaReplicationEndpoint.RegionReplicaReplayCallable
@Private
public abstract class RegionAdminServiceCallable<T>
extends Object
implements RetryingCallable<T>
Similar to RegionServerCallable but for the AdminService interface. This service callable assumes
a Table and row and thus does region locating similar to RegionServerCallable. Works against
Admin stub rather than Client stub.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ClusterConnection
private HBaseRpcController
protected HRegionLocation
protected final int
protected final byte[]
protected final RpcControllerFactory
protected org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface
protected final TableName
-
Constructor Summary
ConstructorDescriptionRegionAdminServiceCallable
(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) -
Method Summary
Modifier and TypeMethodDescriptioncall
(int callTimeout) Override that changes Exception fromException
toIOException
.protected abstract T
call
(HBaseRpcController rpcController) Run RPC call.(package private) Connection
ReturnsConnection
instance used by this Callable.(package private) HBaseRpcController
protected String
Returns Some details from the implementation that we would like to add to a terminating exception; i.e.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) Sleep and retry.void
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.).
-
Field Details
-
stub
protected org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface stub -
rpcControllerFactory
-
controller
-
connection
-
location
-
tableName
-
row
-
replicaId
-
-
Constructor Details
-
RegionAdminServiceCallable
public RegionAdminServiceCallable(ClusterConnection connection, RpcControllerFactory rpcControllerFactory, TableName tableName, byte[] row) -
RegionAdminServiceCallable
public RegionAdminServiceCallable(ClusterConnection connection, RpcControllerFactory rpcControllerFactory, HRegionLocation location, TableName tableName, byte[] row) -
RegionAdminServiceCallable
public RegionAdminServiceCallable(ClusterConnection connection, RpcControllerFactory rpcControllerFactory, HRegionLocation location, TableName tableName, byte[] row, int replicaId)
-
-
Method Details
-
prepare
Description copied from interface:RetryingCallable
Prepare by setting up any connections to servers, etc., ahead of call invocation. TODO: We call prepare before EVERY call. Seems wrong. FIX!!!!- Specified by:
prepare
in interfaceRetryingCallable<T>
- Parameters:
reload
- Set this to true if need to requery locations- Throws:
IOException
- e
-
setStub
protected void setStub(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface stub) -
getLocation
- Throws:
IOException
-
throwable
Description copied from interface:RetryingCallable
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.).- Specified by:
throwable
in interfaceRetryingCallable<T>
- Parameters:
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)
-
getConnection
ReturnsConnection
instance used by this Callable. -
getExceptionMessage
-
getExceptionMessageAdditionalDetail
Description copied from interface:RetryingCallable
Returns Some details from the implementation that we would like to add to a terminating exception; i.e. a fatal exception is being thrown ending retries and we might like to add more implementation-specific detail on to the exception being thrown.- Specified by:
getExceptionMessageAdditionalDetail
in interfaceRetryingCallable<T>
-
sleep
Description copied from interface:RetryingCallable
Sleep and retry.- Specified by:
sleep
in interfaceRetryingCallable<T>
- Parameters:
pause
- time to pausetries
- amount of tries until till sleep- Returns:
- Suggestion on how much to sleep between retries
-
getRegionLocations
public static RegionLocations getRegionLocations(ClusterConnection connection, TableName tableName, byte[] row, boolean useCache, int replicaId) throws RetriesExhaustedException, DoNotRetryIOException, InterruptedIOException -
call
Override that changes Exception fromException
toIOException
. It also does setup of an rpcController and calls through to the unimplemented call(PayloadCarryingRpcController) method; implement this method to add your rpc invocation.- Specified by:
call
in interfaceRetryingCallable<T>
- Parameters:
callTimeout
- - the time available for this call. 0 for infinite.- Returns:
- computed result
- Throws:
IOException
-
getCurrentPayloadCarryingRpcController
-
call
Run RPC call.- Parameters:
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.- Throws:
Exception
-