T - @InterfaceAudience.Private
public interface AsyncRetryingCallable<T>
call(ResponseHandler) invocation throws exceptions,
we will call throwable(Throwable, boolean) with whatever the exception was.| Modifier and Type | Method and Description |
|---|---|
void |
call(ResponseHandler<T> handler)
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
call(ResponseHandler) invocation. |
long |
sleep(long pause,
int tries) |
void |
throwable(java.lang.Throwable t,
boolean retrying)
Called when
call(ResponseHandler) 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 java.io.IOException
call(ResponseHandler) invocation.reload - Set this to true if need to requery locations (usually set on second invocation
to call(ResponseHandler) )} or whateverjava.io.IOException - evoid throwable(java.lang.Throwable t,
boolean retrying)
call(ResponseHandler) 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)java.lang.String getExceptionMessageAdditionalDetail()
long sleep(long pause,
int tries)
pause - before retrytries - count of triesvoid call(ResponseHandler<T> handler)
handler - handler for computed result