org.apache.hadoop.hbase.client
Class RpcRetryingCaller<T>

java.lang.Object
  extended by org.apache.hadoop.hbase.client.RpcRetryingCaller<T>
Direct Known Subclasses:
StatsTrackingRpcRetryingCaller

@InterfaceAudience.Private
public class RpcRetryingCaller<T>
extends Object

Dynamic rather than static so can set the generic return type appropriately.


Constructor Summary
RpcRetryingCaller(long pause, int retries, int startLogErrorsCnt)
           
 
Method Summary
 T callWithoutRetries(RetryingCallable<T> callable, int callTimeout)
          Call the server once only.
 T callWithRetries(RetryingCallable<T> callable)
           
 T callWithRetries(RetryingCallable<T> callable, int callTimeout)
          Retries if invocation fails.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RpcRetryingCaller

public RpcRetryingCaller(long pause,
                         int retries,
                         int startLogErrorsCnt)
Method Detail

callWithRetries

public T callWithRetries(RetryingCallable<T> callable)
                  throws IOException,
                         RuntimeException
Throws:
IOException
RuntimeException

callWithRetries

public T callWithRetries(RetryingCallable<T> callable,
                         int callTimeout)
                  throws IOException,
                         RuntimeException
Retries if invocation fails.

Parameters:
callTimeout - Timeout for this call
callable - The RetryingCallable to run.
Returns:
an object of type T
Throws:
IOException - if a remote or network exception occurs
RuntimeException - other unspecified error

callWithoutRetries

public T callWithoutRetries(RetryingCallable<T> callable,
                            int callTimeout)
                     throws IOException,
                            RuntimeException
Call the server once only. RetryingCallable has a strange shape so we can do retrys. Use this invocation if you want to do a single call only (A call to Callable.call() will not likely succeed).

Returns:
an object of type T
Throws:
IOException - if a remote or network exception occurs
RuntimeException - other unspecified error


Copyright © 2007-2015 The Apache Software Foundation. All Rights Reserved.