class ScannerCallableWithReplicas.RetryingRPC extends Object implements RetryingCallable<Pair<Result[],ScannerCallable>>, Cancellable
| Modifier and Type | Field and Description |
|---|---|
(package private) ScannerCallable |
callable |
(package private) RpcRetryingCaller<Result[]> |
caller |
private boolean |
cancelled |
| Constructor and Description |
|---|
ScannerCallableWithReplicas.RetryingRPC(ScannerCallable callable) |
| Modifier and Type | Method and Description |
|---|---|
Pair<Result[],ScannerCallable> |
call(int callTimeout)
Computes a result, or throws an exception if unable to do so.
|
void |
cancel() |
String |
getExceptionMessageAdditionalDetail() |
boolean |
isCancelled() |
void |
prepare(boolean reload)
Prepare by setting up any connections to servers, etc., ahead of
RetryingCallable.call(int) invocation. |
long |
sleep(long pause,
int tries) |
void |
throwable(Throwable t,
boolean retrying)
Called when
RetryingCallable.call(int) 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.). |
final ScannerCallable callable
RpcRetryingCaller<Result[]> caller
private volatile boolean cancelled
ScannerCallableWithReplicas.RetryingRPC(ScannerCallable callable)
public Pair<Result[],ScannerCallable> call(int callTimeout) throws IOException
RetryingCallablecall in interface RetryingCallable<Pair<Result[],ScannerCallable>>callTimeout - - the time available for this call. 0 for infinite.IOExceptionpublic void prepare(boolean reload)
throws IOException
RetryingCallableRetryingCallable.call(int) invocation.prepare in interface RetryingCallable<Pair<Result[],ScannerCallable>>reload - Set this to true if need to requery locationsIOException - epublic void throwable(Throwable t, boolean retrying)
RetryingCallableRetryingCallable.call(int) 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.).throwable in interface RetryingCallable<Pair<Result[],ScannerCallable>>retrying - 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)public String getExceptionMessageAdditionalDetail()
getExceptionMessageAdditionalDetail in interface RetryingCallable<Pair<Result[],ScannerCallable>>public long sleep(long pause,
int tries)
sleep in interface RetryingCallable<Pair<Result[],ScannerCallable>>public void cancel()
cancel in interface Cancellablepublic boolean isCancelled()
isCancelled in interface CancellableCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.