Package org.apache.hadoop.io.retry
@LimitedPrivate({"HBase","HDFS","MapReduce"})
@Evolving
package org.apache.hadoop.io.retry
A mechanism for selectively retrying methods that throw exceptions under
certain circumstances.
Typical usage is
UnreliableImplementation unreliableImpl = new UnreliableImplementation();
UnreliableInterface unreliable = (UnreliableInterface)
RetryProxy.create(UnreliableInterface.class, unreliableImpl,
RetryPolicies.retryUpToMaximumCountWithFixedSleep(4, 10,
TimeUnit.SECONDS));
unreliable.call();
This will retry any method called on
unreliable four times -
in this case the call() method - sleeping 10 seconds between
each retry. There are a number of
retry policies
available, or you can implement a custom one by implementing
RetryPolicy.
It is also possible to specify retry policies on a
per-method basis.-
ClassDescriptionHandle async calls.Used to mark certain methods of an interface with at-most-once semantics.An implementation of
FailoverProxyProviderwhich does nothing in the event of failover, and always returns the same proxy object.An implementer of this interface is capable of providing proxy objects for use in IPC communication, and potentially modifying these objects or creating entirely new ones in the event of certain types of failures.Used to mark certain methods of an interface as being idempotent, and therefore warrant being retried on failover.A dummy invocation handler extending RetryInvocationHandler.Holder class that clients can use to return multiple exceptions.ARpcInvocationHandlerwhich supports client side retry .A collection of useful implementations ofRetryPolicy.Given pairs of number of retries and sleep time (n0, t0), (n1, t1), ..., the first n0 retries sleep t0 milliseconds on average, the following n1 retries sleep t1 milliseconds on average, and so on.Pairs of numRetries and sleepSecondsSpecifies a policy for retrying method failures.A factory for creating retry proxies.