ConfiguredFailoverProxyProvider (Apache Hadoop HDFS Client 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.server.namenode.ha, class: ConfiguredFailoverProxyProvider

Package org.apache.hadoop.hdfs.server.namenode.ha

# 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.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.hadoop.hdfs.server.namenode.ha.AbstractNNFailoverProxyProvider

  `AbstractNNFailoverProxyProvider.NNProxyInfo<T>`

  ## 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
  Modifier and Type
  Field
  Description
  `protected final List<AbstractNNFailoverProxyProvider.NNProxyInfo<T>>`
  `proxies`

  ### Fields inherited from class org.apache.hadoop.hdfs.server.namenode.ha.AbstractNNFailoverProxyProvider

  `conf, factory, fallbackToSimpleAuth, LOG, ugi, xface`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ConfiguredFailoverProxyProvider(org.apache.hadoop.conf.Configuration conf, URI uri, Class<T> xface, HAProxyFactory<T> factory)`
  `ConfiguredFailoverProxyProvider(org.apache.hadoop.conf.Configuration conf, URI uri, Class<T> xface, HAProxyFactory<T> factory, String addressKey)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  Close all the proxy objects which have been opened over the lifetime of this proxy provider.
  `org.apache.hadoop.io.retry.FailoverProxyProvider.ProxyInfo<T>`
  `getProxy()`
  Lazily initialize the RPC proxy object.
  `void`
  `performFailover(T currentProxy)`
  `boolean`
  `useLogicalURI()`
  Logical URI is required for this failover proxy provider.

  ### Methods inherited from class org.apache.hadoop.hdfs.server.namenode.ha.AbstractNNFailoverProxyProvider

  `createProxyIfNeeded, getFallbackToSimpleAuth, getInterface, getProxyAddresses, getRandomOrder, setFallbackToSimpleAuth`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### proxies

    protected final List<AbstractNNFailoverProxyProvider.NNProxyInfo<T>> proxies

- ## 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.