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

## Class AbstractNNFailoverProxyProvider<T>

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

- All Implemented Interfaces:
    Closeable, AutoCloseable, org.apache.hadoop.io.retry.FailoverProxyProvider<T>
  Direct Known Subclasses:
    ConfiguredFailoverProxyProvider, IPFailoverProxyProvider, WrappedFailoverProxyProvider

      public abstract class AbstractNNFailoverProxyProvider<T>
      extends Object
      implements org.apache.hadoop.io.retry.FailoverProxyProvider<T>

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `AbstractNNFailoverProxyProvider.NNProxyInfo<T>` ProxyInfo to a NameNode.

    - ### Nested classes/interfaces inherited from interface org.apache.hadoop.io.retry.FailoverProxyProvider

      `org.apache.hadoop.io.retry.FailoverProxyProvider.ProxyInfo<T>`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected org.apache.hadoop.conf.Configuration` | `conf`
    `protected org.apache.hadoop.hdfs.server.namenode.ha.HAProxyFactory<T>` | `factory`
    `protected AtomicBoolean` | `fallbackToSimpleAuth`
    `protected static org.slf4j.Logger` | `LOG`
    `protected org.apache.hadoop.security.UserGroupInformation` | `ugi`
    `protected Class<T>` | `xface`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractNNFailoverProxyProvider()`
    `protected` | `AbstractNNFailoverProxyProvider(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 Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected AbstractNNFailoverProxyProvider.NNProxyInfo<T>` | `createProxyIfNeeded(AbstractNNFailoverProxyProvider.NNProxyInfo<T> pi)` Create a proxy if it has not been created yet.
    `AtomicBoolean` | `getFallbackToSimpleAuth()`
    `Class<T>` | `getInterface()`
    `protected List<AbstractNNFailoverProxyProvider.NNProxyInfo<T>>` | `getProxyAddresses(URI uri, String addressKey)` Get list of configured NameNode proxy addresses.
    `static boolean` | `getRandomOrder(org.apache.hadoop.conf.Configuration conf, URI nameNodeUri)` Check whether random order is configured for failover proxy provider for the namenode/nameservice.
    `void` | `setFallbackToSimpleAuth(AtomicBoolean fallbackToSimpleAuth)` Set for tracking if a secure client falls back to simple auth.
    `abstract boolean` | `useLogicalURI()` Inquire whether logical HA URI is used for the implementation.

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

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

    - ### Methods inherited from interface org.apache.hadoop.io.retry.FailoverProxyProvider

      `getProxy, performFailover`

    - ### Methods inherited from interface java.io.Closeable

      `close`

- - ### Field Detail

    - #### LOG

          protected static final org.slf4j.Logger LOG

    - #### conf

          protected org.apache.hadoop.conf.Configuration conf

    - #### xface

          protected Class<T> xface

    - #### factory

          protected org.apache.hadoop.hdfs.server.namenode.ha.HAProxyFactory<T> factory

    - #### ugi

          protected org.apache.hadoop.security.UserGroupInformation ugi

    - #### fallbackToSimpleAuth

          protected AtomicBoolean fallbackToSimpleAuth

  - ### Constructor Detail

    - #### AbstractNNFailoverProxyProvider

          protected AbstractNNFailoverProxyProvider()

    - #### AbstractNNFailoverProxyProvider

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

  - ### Method Detail

    - #### useLogicalURI

          public abstract boolean useLogicalURI()

      Inquire whether logical HA URI is used for the implementation. If it is used, a special token handling may be needed to make sure a token acquired from a node in the HA pair can be used against the other node.
      Returns:
        true if logical HA URI is used. false, if not used.

    - #### setFallbackToSimpleAuth

          public void setFallbackToSimpleAuth(AtomicBoolean fallbackToSimpleAuth)

      Set for tracking if a secure client falls back to simple auth. This method is synchronized only to stifle a Findbugs warning.
      Parameters:
        `fallbackToSimpleAuth` - - set to true or false during this method to indicate if a secure client falls back to simple auth

    - #### getFallbackToSimpleAuth

          public AtomicBoolean getFallbackToSimpleAuth()

    - #### getInterface

          public Class<T> getInterface()

      Specified by:
        `getInterface` in interface `org.apache.hadoop.io.retry.FailoverProxyProvider<T>`

    - #### createProxyIfNeeded

          protected AbstractNNFailoverProxyProvider.NNProxyInfo<T> createProxyIfNeeded(AbstractNNFailoverProxyProvider.NNProxyInfo<T> pi)

      Create a proxy if it has not been created yet.

    - #### getProxyAddresses

          protected List<AbstractNNFailoverProxyProvider.NNProxyInfo<T>> getProxyAddresses(URI uri,
                                                                                           String addressKey)

      Get list of configured NameNode proxy addresses. Randomize the list if requested.

    - #### getRandomOrder

          public static boolean getRandomOrder(org.apache.hadoop.conf.Configuration conf,
                                               URI nameNodeUri)

      Check whether random order is configured for failover proxy provider for the namenode/nameservice.
      Parameters:
        `conf` - Configuration
        `nameNodeUri` - The URI of namenode/nameservice
      Returns:
        random order configuration

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