org.apache.hadoop.io.retry
Interface RetryPolicy


public interface RetryPolicy

Specifies a policy for retrying method failures. Implementations of this interface should be immutable.


Method Summary
 boolean shouldRetry(Exception e, int retries)
           Determines whether the framework should retry a method for the given exception, and the number of retries that have been made for that operation so far.
 

Method Detail

shouldRetry

boolean shouldRetry(Exception e,
                    int retries)
                    throws Exception

Determines whether the framework should retry a method for the given exception, and the number of retries that have been made for that operation so far.

Parameters:
e - The exception that caused the method to fail.
retries - The number of times the method has been retried.
Returns:
true if the method should be retried, false if the method should not be retried but shouldn't fail with an exception (only for void methods).
Throws:
Exception - The re-thrown exception e indicating that the method failed and should not be retried further.


Copyright © 2009 The Apache Software Foundation