@InterfaceAudience.LimitedPrivate(value={"HBase","HDFS","MapReduce"}) @InterfaceStability.Evolving
See: Description
Interface | Description |
---|---|
FailoverProxyProvider<T> |
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.
|
RetryPolicy |
Specifies a policy for retrying method failures.
|
Class | Description |
---|---|
DefaultFailoverProxyProvider<T> |
An implementation of
FailoverProxyProvider which does nothing in the
event of failover, and always returns the same proxy object. |
LossyRetryInvocationHandler<T> |
A dummy invocation handler extending RetryInvocationHandler.
|
RetryInvocationHandler<T> |
This class implements RpcInvocationHandler and supports retry on the client
side.
|
RetryPolicies |
A collection of useful implementations of
RetryPolicy . |
RetryPolicies.MultipleLinearRandomRetry |
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.
|
RetryPolicies.MultipleLinearRandomRetry.Pair |
Pairs of numRetries and sleepSeconds
|
RetryPolicy.RetryAction | |
RetryProxy |
A factory for creating retry proxies.
|
RetryUtils |
Enum | Description |
---|---|
RetryPolicy.RetryAction.RetryDecision |
Annotation Type | Description |
---|---|
AtMostOnce |
Used to mark certain methods of an interface with at-most-once semantics.
|
Idempotent |
Used to mark certain methods of an interface as being idempotent, and
therefore warrant being retried on failover.
|
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
.
Copyright © 2013 Apache Software Foundation. All rights reserved.