T
- @InterfaceAudience.Private public interface RetryingCallable<T>
call(int)
invocation throws exceptions,
we will call throwable(Throwable, boolean)
with whatever the exception was.Modifier and Type | Method and Description |
---|---|
T |
call(int callTimeout)
Computes a result, or throws an exception if unable to do so.
|
String |
getExceptionMessageAdditionalDetail() |
void |
prepare(boolean reload)
Prepare by setting up any connections to servers, etc., ahead of
call(int) invocation. |
long |
sleep(long pause,
int tries) |
void |
throwable(Throwable t,
boolean retrying)
Called when
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.). |
void prepare(boolean reload) throws IOException
call(int)
invocation.reload
- Set this to true if need to requery locationsIOException
- evoid throwable(Throwable t, boolean retrying)
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.).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)T call(int callTimeout) throws Exception
callTimeout
- - the time available for this call. 0 for infinite.Exception
- if unable to compute a resultString getExceptionMessageAdditionalDetail()
long sleep(long pause, int tries)
pause
- tries
-