@InterfaceAudience.Private public class DelegatingRetryingCallable<T,D extends RetryingCallable<T>> extends java.lang.Object implements RetryingCallable<T>
| Constructor and Description |
|---|
DelegatingRetryingCallable(D delegate) |
| Modifier and Type | Method and Description |
|---|---|
T |
call(int callTimeout)
Computes a result, or throws an exception if unable to do so.
|
java.lang.String |
getExceptionMessageAdditionalDetail() |
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(java.lang.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.). |
protected final D extends RetryingCallable<T> delegate
public DelegatingRetryingCallable(D delegate)
public T call(int callTimeout) throws java.lang.Exception
RetryingCallablecall in interface RetryingCallable<T>callTimeout - - the time available for this call. 0 for infinite.java.lang.Exception - if unable to compute a resultpublic void prepare(boolean reload)
throws java.io.IOException
RetryingCallableRetryingCallable.call(int) invocation.prepare in interface RetryingCallable<T>reload - Set this to true if need to requery locationsjava.io.IOException - epublic void throwable(java.lang.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<T>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 java.lang.String getExceptionMessageAdditionalDetail()
getExceptionMessageAdditionalDetail in interface RetryingCallable<T>public long sleep(long pause,
int tries)
sleep in interface RetryingCallable<T>