T
- @InterfaceAudience.Private public interface RetryingCallable<T> extends Callable<T>
Callable.call()
invocation throws exceptions,
we will call throwable(Throwable, boolean)
with whatever the exception was.Modifier and Type | Method and Description |
---|---|
String |
getExceptionMessageAdditionalDetail() |
void |
prepare(boolean reload)
Prepare by setting up any connections to servers, etc., ahead of
Callable.call() invocation. |
long |
sleep(long pause,
int tries) |
void |
throwable(Throwable t,
boolean retrying)
Called when
Callable.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.). |
void prepare(boolean reload) throws IOException
Callable.call()
invocation.reload
- Set this to true if need to requery locations (usually set on second invocation
to Callable.call()
or whateverIOException
- evoid throwable(Throwable t, boolean retrying)
Callable.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.).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)String getExceptionMessageAdditionalDetail()
long sleep(long pause, int tries)
pause
- tries
- Copyright © 2013 The Apache Software Foundation. All Rights Reserved.