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

## Class IPFailoverProxyProvider<T>

- java.lang.Object
- - org.apache.hadoop.hdfs.server.namenode.ha.AbstractNNFailoverProxyProvider<T>
  - - org.apache.hadoop.hdfs.server.namenode.ha.IPFailoverProxyProvider<T>

- All Implemented Interfaces:
    Closeable, AutoCloseable, org.apache.hadoop.io.retry.FailoverProxyProvider<T>

      public class IPFailoverProxyProvider<T>
      extends AbstractNNFailoverProxyProvider<T>

  A NNFailoverProxyProvider implementation which works on IP failover setup. Only one proxy is used to connect to both servers and switching between the servers is done by the environment/infrastructure, which guarantees clients can consistently reach only one node at a time. Clients with a live connection will likely get connection reset after an IP failover. This case will be handled by the FailoverOnNetworkExceptionRetry retry policy. I.e. if the call is not idempotent, it won't get retried. A connection reset while setting up a connection (i.e. before sending a request) will be handled in ipc client. The namenode URI must contain a resolvable host name.

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

  - ### Field Summary

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

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IPFailoverProxyProvider(org.apache.hadoop.conf.Configuration conf, URI uri, Class<T> xface, org.apache.hadoop.hdfs.server.namenode.ha.HAProxyFactory<T> factory)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close the proxy,
    `AbstractNNFailoverProxyProvider.NNProxyInfo<T>` | `getProxy()`
    `void` | `performFailover(T currentProxy)` Nothing to do for IP failover
    `boolean` | `useLogicalURI()` Logical URI is not used for IP failover.

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

- - ### Constructor Detail

    - #### IPFailoverProxyProvider

          public IPFailoverProxyProvider(org.apache.hadoop.conf.Configuration conf,
                                         URI uri,
                                         Class<T> xface,
                                         org.apache.hadoop.hdfs.server.namenode.ha.HAProxyFactory<T> factory)

  - ### Method Detail

    - #### getProxy

          public AbstractNNFailoverProxyProvider.NNProxyInfo<T> getProxy()

    - #### performFailover

          public void performFailover(T currentProxy)

      Nothing to do for IP failover

    - #### close

          public void close()
                     throws IOException

      Close the proxy,
      Throws:
        `IOException`

    - #### useLogicalURI

          public boolean useLogicalURI()

      Logical URI is not used for IP failover.
      Specified by:
        `useLogicalURI` in class `AbstractNNFailoverProxyProvider<T>`
      Returns:
        true if logical HA URI is used. false, if not used.

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.