Package org.apache.hadoop.io.retry
Class DefaultFailoverProxyProvider<T>
java.lang.Object
org.apache.hadoop.io.retry.DefaultFailoverProxyProvider<T>
- All Implemented Interfaces:
Closeable,AutoCloseable,FailoverProxyProvider<T>
@Evolving
public class DefaultFailoverProxyProvider<T>
extends Object
implements FailoverProxyProvider<T>
An implementation of
FailoverProxyProvider which does nothing in the
event of failover, and always returns the same proxy object.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.io.retry.FailoverProxyProvider
FailoverProxyProvider.ProxyInfo<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Return 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.
-
Constructor Details
-
DefaultFailoverProxyProvider
-
-
Method Details
-
getInterface
Description copied from interface:FailoverProxyProviderReturn 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.- Specified by:
getInterfacein interfaceFailoverProxyProvider<T>- Returns:
- the interface implemented by the proxy objects returned by
FailoverProxyProvider.getProxy()
-
getProxy
Description copied from interface:FailoverProxyProviderGet the proxy object which should be used until the next failover event occurs.- Specified by:
getProxyin interfaceFailoverProxyProvider<T>- Returns:
- the proxy object to invoke methods upon
-
performFailover
Description copied from interface:FailoverProxyProviderCalled whenever the associatedRetryPolicydetermines that an error warrants failing over.- Specified by:
performFailoverin interfaceFailoverProxyProvider<T>- Parameters:
currentProxy- the proxy object which was being used before this failover event
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-