@InterfaceAudience.Private public class RpcRetryingCallerImpl<T> extends Object implements RpcRetryingCaller<T>
RetryingCallable
. Sets into rpc client threadlocal outstanding timeouts
as so we don't persist too much. Dynamic rather than static so can set the generic appropriately.
This object has a state. It should not be used by in parallel by different threads. Reusing it is
possible however, even between multiple threads. However, the user will have to manage the
synchronization on its side: there is no synchronization inside the class.Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
RpcRetryingCallerImpl(long pause,
long pauseForServerOverloaded,
int retries,
int startLogErrorsCnt) |
RpcRetryingCallerImpl(long pause,
long pauseForServerOverloaded,
int retries,
org.apache.hadoop.hbase.client.RetryingCallerInterceptor interceptor,
int startLogErrorsCnt,
int rpcTimeout) |
Modifier and Type | Method and Description |
---|---|
T |
callWithoutRetries(RetryingCallable<T> callable,
int callTimeout)
Call the server once only.
|
T |
callWithRetries(RetryingCallable<T> callable,
int callTimeout)
Retries if invocation fails.
|
void |
cancel() |
String |
toString() |
public RpcRetryingCallerImpl(long pause, long pauseForServerOverloaded, int retries, int startLogErrorsCnt)
public RpcRetryingCallerImpl(long pause, long pauseForServerOverloaded, int retries, org.apache.hadoop.hbase.client.RetryingCallerInterceptor interceptor, int startLogErrorsCnt, int rpcTimeout)
public void cancel()
cancel
in interface RpcRetryingCaller<T>
public T callWithRetries(RetryingCallable<T> callable, int callTimeout) throws IOException, RuntimeException
RpcRetryingCaller
callWithRetries
in interface RpcRetryingCaller<T>
callable
- The RetryingCallable
to run.callTimeout
- Timeout for this callIOException
- if a remote or network exception occursRuntimeException
- other unspecified errorpublic T callWithoutRetries(RetryingCallable<T> callable, int callTimeout) throws IOException, RuntimeException
RpcRetryingCaller
RetryingCallable
has a strange shape so we can do retries.
Use this invocation if you want to do a single call only (A call to
RetryingCallable.call(int)
will not likely succeed).callWithoutRetries
in interface RpcRetryingCaller<T>
IOException
- if a remote or network exception occursRuntimeException
- other unspecified errorCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.