Package org.apache.hadoop.hbase.client
Class ScannerCallableWithReplicas.RetryingRPC
java.lang.Object
org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.RetryingRPC
- All Implemented Interfaces:
Cancellable,RetryingCallable<Pair<Result[],ScannerCallable>>
- Enclosing class:
- ScannerCallableWithReplicas
class ScannerCallableWithReplicas.RetryingRPC
extends Object
implements RetryingCallable<Pair<Result[],ScannerCallable>>, Cancellable
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final ScannerCallable(package private) RpcRetryingCaller<Result[]>private boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall(int callTimeout) Computes a result, or throws an exception if unable to do so.voidcancel()Returns Some details from the implementation that we would like to add to a terminating exception; i.e.booleanvoidprepare(boolean reload) Prepare by setting up any connections to servers, etc., ahead of call invocation.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
-
callable
-
caller
-
cancelled
-
-
Constructor Details
-
RetryingRPC
RetryingRPC(ScannerCallable callable)
-
-
Method Details
-
call
Description copied from interface:RetryingCallableComputes a result, or throws an exception if unable to do so.- Specified by:
callin interfaceRetryingCallable<Pair<Result[],ScannerCallable>> - Parameters:
callTimeout- - the time available for this call. 0 for infinite.- Returns:
- computed result
- Throws:
IOException
-
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<Pair<Result[],ScannerCallable>> - Parameters:
reload- Set this to true if need to requery locations- Throws:
IOException- e
-
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<Pair<Result[],ScannerCallable>> - 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)
-
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<Pair<Result[],ScannerCallable>>
-
sleep
Description copied from interface:RetryingCallableSleep and retry.- Specified by:
sleepin interfaceRetryingCallable<Pair<Result[],ScannerCallable>> - Parameters:
pause- time to pausetries- amount of tries until till sleep- Returns:
- Suggestion on how much to sleep between retries
-
cancel
- Specified by:
cancelin interfaceCancellable
-
isCancelled
- Specified by:
isCancelledin interfaceCancellable
-