Class ConfiguredFailoverProxyProvider<T>

java.lang.Object
org.apache.hadoop.hdfs.server.namenode.ha.AbstractNNFailoverProxyProvider<T>
org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider<T>
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.hadoop.io.retry.FailoverProxyProvider<T>
Direct Known Subclasses:
InMemoryAliasMapFailoverProxyProvider, RequestHedgingProxyProvider

public class ConfiguredFailoverProxyProvider<T> extends AbstractNNFailoverProxyProvider<T>
A FailoverProxyProvider implementation which allows one to configure multiple URIs to connect to during fail-over. A random configured address is tried first, and on a fail-over event the other addresses are tried sequentially in a random order.
  • Field Details

  • Constructor Details

    • ConfiguredFailoverProxyProvider

      public ConfiguredFailoverProxyProvider(org.apache.hadoop.conf.Configuration conf, URI uri, Class<T> xface, HAProxyFactory<T> factory)
    • ConfiguredFailoverProxyProvider

      public ConfiguredFailoverProxyProvider(org.apache.hadoop.conf.Configuration conf, URI uri, Class<T> xface, HAProxyFactory<T> factory, String addressKey)
  • Method Details

    • getProxy

      public org.apache.hadoop.io.retry.FailoverProxyProvider.ProxyInfo<T> getProxy()
      Lazily initialize the RPC proxy object.
    • performFailover

      public void performFailover(T currentProxy)
    • close

      public void close() throws IOException
      Close all the proxy objects which have been opened over the lifetime of this proxy provider.
      Throws:
      IOException
    • useLogicalURI

      public boolean useLogicalURI()
      Logical URI is required for this failover proxy provider.
      Specified by:
      useLogicalURI in class AbstractNNFailoverProxyProvider<T>
      Returns:
      true if logical HA URI is used. false, if not used.