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
FieldsModifier and TypeFieldDescriptionprotected final ClusterConnectionprivate HBaseRpcControllerprotected HRegionLocationprotected final intprotected final byte[]protected final RpcControllerFactoryprotected org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterfaceprotected final TableName -
Constructor Summary
ConstructorsConstructorDescriptionRegionAdminServiceCallable(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 fromExceptiontoIOException.protected abstract Tcall(HBaseRpcController rpcController) Run RPC call.(package private) ConnectionReturnsConnectioninstance used by this Callable.(package private) HBaseRpcControllerprotected StringReturns Some details from the implementation that we would like to add to a terminating exception; i.e.getLocation(boolean useCache) static RegionLocationsgetRegionLocations(ClusterConnection connection, TableName tableName, byte[] row, boolean useCache, int replicaId) voidprepare(boolean reload) Prepare by setting up any connections to servers, etc., ahead of call invocation.protected voidsetStub(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface stub) longsleep(long pause, int tries) Sleep and retry.voidCalled 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:RetryingCallablePrepare by setting up any connections to servers, etc., ahead of call invocation. TODO: We call prepare before EVERY call. Seems wrong. FIX!!!!- Specified by:
preparein 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:RetryingCallableCalled 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:
throwablein 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
ReturnsConnectioninstance used by this Callable. -
getExceptionMessage
-
getExceptionMessageAdditionalDetail
Description copied from interface:RetryingCallableReturns 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:
getExceptionMessageAdditionalDetailin interfaceRetryingCallable<T>
-
sleep
Description copied from interface:RetryingCallableSleep and retry.- Specified by:
sleepin 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 fromExceptiontoIOException. 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:
callin 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
-