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>

public class RequestHedgingRMFailoverProxyProvider<T> extends ConfiguredRMFailoverProxyProvider<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.
  • 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: RMFailoverProxyProvider
      Initialize internal data structures, invoked right after instantiation.
      Specified by:
      init in interface RMFailoverProxyProvider<T>
      Overrides:
      init in class ConfiguredRMFailoverProxyProvider<T>
      Parameters:
      configuration - Configuration to use
      rmProxy - The RMProxy instance to use
      protocol - The communication protocol to use
    • createRetriableProxy

      protected T createRetriableProxy()
    • getProxy

      public org.apache.hadoop.io.retry.FailoverProxyProvider.ProxyInfo<T> getProxy()
      Specified by:
      getProxy in interface org.apache.hadoop.io.retry.FailoverProxyProvider<T>
      Overrides:
      getProxy in class ConfiguredRMFailoverProxyProvider<T>
    • performFailover

      public void performFailover(T currentProxy)
      Specified by:
      performFailover in interface org.apache.hadoop.io.retry.FailoverProxyProvider<T>
      Overrides:
      performFailover in class ConfiguredRMFailoverProxyProvider<T>