Package org.apache.hadoop.io.retry
Interface FailoverProxyProvider<T>
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
DefaultFailoverProxyProvider
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. The
determination of whether or not to fail over is handled by
RetryPolicy.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionReturn a reference to the interface this provider's proxy objects actually implement.getProxy()Get the proxy object which should be used until the next failover event occurs.voidperformFailover(T currentProxy) Called whenever the associatedRetryPolicydetermines that an error warrants failing over.
-
Method Details
-
getProxy
FailoverProxyProvider.ProxyInfo<T> getProxy()Get the proxy object which should be used until the next failover event occurs.- Returns:
- the proxy object to invoke methods upon
-
performFailover
Called whenever the associatedRetryPolicydetermines that an error warrants failing over.- Parameters:
currentProxy- the proxy object which was being used before this failover event
-
getInterface
Return a reference to the interface this provider's proxy objects actually implement. If any of the methods on this interface are annotated as beingIdempotentorAtMostOnce, then this fact will be passed to theRetryPolicy.shouldRetry(Exception, int, int, boolean)method on error, for use in determining whether or not failover should be attempted.- Returns:
- the interface implemented by the proxy objects returned by
getProxy()
-