V
- return typeabstract class RpcRetryingCallable<V> extends Object implements RetryingCallable<V>, Closeable
Constructor and Description |
---|
RpcRetryingCallable() |
Modifier and Type | Method and Description |
---|---|
V |
call(int callTimeout)
Computes a result, or throws an exception if unable to do so.
|
void |
close() |
String |
getExceptionMessageAdditionalDetail()
Returns Some details from the implementation that we would like to add to a terminating
exception; i.e.
|
void |
prepare(boolean reload)
Prepare by setting up any connections to servers, etc., ahead of call invocation.
|
protected abstract V |
rpcCall(int callTimeout) |
long |
sleep(long pause,
int tries)
Sleep and retry.
|
void |
throwable(Throwable t,
boolean retrying)
Called when 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.).
|
RpcRetryingCallable()
public void prepare(boolean reload) throws IOException
RetryingCallable
prepare
in interface RetryingCallable<V>
reload
- Set this to true if need to requery locationsIOException
- epublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void throwable(Throwable t, boolean retrying)
RetryingCallable
throwable
in interface RetryingCallable<V>
t
- throwable which was thrownretrying
- 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()
RetryingCallable
getExceptionMessageAdditionalDetail
in interface RetryingCallable<V>
public long sleep(long pause, int tries)
RetryingCallable
sleep
in interface RetryingCallable<V>
pause
- time to pausetries
- amount of tries until till sleeppublic V call(int callTimeout) throws IOException
RetryingCallable
call
in interface RetryingCallable<V>
callTimeout
- - the time available for this call. 0 for infinite.IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.