org.apache.hadoop.hbase.client
Interface RetryingCallable<T>

Type Parameters:
T -
All Superinterfaces:
Callable<T>
All Known Implementing Classes:
DelegatingRetryingCallable, RegionServerCallable, ScannerCallable

@InterfaceAudience.Private
public interface RetryingCallable<T>
extends Callable<T>

A Callable that will be retried. If Callable.call() invocation throws exceptions, we will call throwable(Throwable, boolean) with whatever the exception was.


Method Summary
 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.).
 
Methods inherited from interface java.util.concurrent.Callable
call
 

Method Detail

prepare

void prepare(boolean reload)
             throws IOException
Prepare by setting up any connections to servers, etc., ahead of Callable.call() invocation.

Parameters:
reload - Set this to true if need to requery locations (usually set on second invocation to Callable.call() or whatever
Throws:
IOException - e

throwable

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.).

Parameters:
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)

getExceptionMessageAdditionalDetail

String getExceptionMessageAdditionalDetail()
Returns:
Some details from the implementation that we would like to add to a terminating exception; i.e. a fatal exception is being thrown ending retries and we might like to add more implementation-specific detail on to the exception being thrown.

sleep

long sleep(long pause,
           int tries)
Parameters:
pause -
tries -
Returns:
Suggestion on how much to sleep between retries


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.