Package org.apache.hadoop.yarn.client
Class RequestHedgingRMFailoverProxyProvider<T>
java.lang.Object
org.apache.hadoop.yarn.client.ConfiguredRMFailoverProxyProvider<T>
org.apache.hadoop.yarn.client.RequestHedgingRMFailoverProxyProvider<T>
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.io.retry.FailoverProxyProvider<T>,RMFailoverProxyProvider<T>
A FailoverProxyProvider implementation that technically does not "failover"
per-se. It constructs a wrapper proxy that sends the request to ALL
underlying proxies simultaneously. Each proxy inside the wrapper proxy will
retry the corresponding target. It assumes the in an HA setup, there will be
only one Active, and the active should respond faster than any configured
standbys. Once it receives a response from any one of the configured proxies,
outstanding requests to other proxies are immediately cancelled.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.io.retry.FailoverProxyProvider
org.apache.hadoop.io.retry.FailoverProxyProvider.ProxyInfo<T extends Object> -
Field Summary
Fields inherited from class org.apache.hadoop.yarn.client.ConfiguredRMFailoverProxyProvider
conf, protocol, rmProxy, rmServiceIds -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Torg.apache.hadoop.io.retry.FailoverProxyProvider.ProxyInfo<T>getProxy()voidInitialize internal data structures, invoked right after instantiation.voidperformFailover(T currentProxy) Methods inherited from class org.apache.hadoop.yarn.client.ConfiguredRMFailoverProxyProvider
close, getInterface, getProxyInternal
-
Constructor Details
-
RequestHedgingRMFailoverProxyProvider
public RequestHedgingRMFailoverProxyProvider()
-
-
Method Details
-
init
public void init(org.apache.hadoop.conf.Configuration configuration, RMProxy<T> rmProxy, Class<T> protocol) Description copied from interface:RMFailoverProxyProviderInitialize internal data structures, invoked right after instantiation.- Specified by:
initin interfaceRMFailoverProxyProvider<T>- Overrides:
initin classConfiguredRMFailoverProxyProvider<T>- Parameters:
configuration- Configuration to usermProxy- TheRMProxyinstance to useprotocol- The communication protocol to use
-
createRetriableProxy
-
getProxy
- Specified by:
getProxyin interfaceorg.apache.hadoop.io.retry.FailoverProxyProvider<T>- Overrides:
getProxyin classConfiguredRMFailoverProxyProvider<T>
-
performFailover
- Specified by:
performFailoverin interfaceorg.apache.hadoop.io.retry.FailoverProxyProvider<T>- Overrides:
performFailoverin classConfiguredRMFailoverProxyProvider<T>
-