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

java.lang.Object
  extended by org.apache.hadoop.hbase.client.RpcRetryingCaller<T>

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

Runs an rpc'ing 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.


Constructor Summary
RpcRetryingCaller(org.apache.hadoop.conf.Configuration conf)
           
 
Method Summary
 T callWithoutRetries(RetryingCallable<T> callable)
          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(org.apache.hadoop.conf.Configuration conf)
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)
                     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 © 2013 The Apache Software Foundation. All Rights Reserved.