Class NameNodeProxies

java.lang.Object
org.apache.hadoop.hdfs.NameNodeProxies

@Private public class NameNodeProxies extends Object
Create proxy objects to communicate with a remote NN. All remote access to an NN should be funneled through this class. Most of the time you'll want to use createProxy(Configuration, URI, Class), which will create either an HA- or non-HA-enabled client proxy as appropriate.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> org.apache.hadoop.hdfs.NameNodeProxiesClient.ProxyAndInfo<T>
    createNonHAProxy(org.apache.hadoop.conf.Configuration conf, InetSocketAddress nnAddr, Class<T> xface, org.apache.hadoop.security.UserGroupInformation ugi, boolean withRetries)
    Creates an explicitly non-HA-enabled proxy object.
    static <T> org.apache.hadoop.hdfs.NameNodeProxiesClient.ProxyAndInfo<T>
    createNonHAProxy(org.apache.hadoop.conf.Configuration conf, InetSocketAddress nnAddr, Class<T> xface, org.apache.hadoop.security.UserGroupInformation ugi, boolean withRetries, AtomicBoolean fallbackToSimpleAuth, org.apache.hadoop.ipc.AlignmentContext alignmentContext)
    Creates an explicitly non-HA-enabled proxy object.
    static <T> org.apache.hadoop.hdfs.NameNodeProxiesClient.ProxyAndInfo<T>
    createProxy(org.apache.hadoop.conf.Configuration conf, URI nameNodeUri, Class<T> xface)
    Creates the namenode proxy with the passed protocol.
    static <T> org.apache.hadoop.hdfs.NameNodeProxiesClient.ProxyAndInfo<T>
    createProxy(org.apache.hadoop.conf.Configuration conf, URI nameNodeUri, Class<T> xface, AtomicBoolean fallbackToSimpleAuth)
    Creates the namenode proxy with the passed protocol.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NameNodeProxies

      public NameNodeProxies()
  • Method Details

    • createProxy

      public static <T> org.apache.hadoop.hdfs.NameNodeProxiesClient.ProxyAndInfo<T> createProxy(org.apache.hadoop.conf.Configuration conf, URI nameNodeUri, Class<T> xface) throws IOException
      Creates the namenode proxy with the passed protocol. This will handle creation of either HA- or non-HA-enabled proxy objects, depending upon if the provided URI is a configured logical URI.
      Parameters:
      conf - the configuration containing the required IPC properties, client failover configurations, etc.
      nameNodeUri - the URI pointing either to a specific NameNode or to a logical nameservice.
      xface - the IPC interface which should be created
      Returns:
      an object containing both the proxy and the associated delegation token service it corresponds to
      Throws:
      IOException - if there is an error creating the proxy
    • createProxy

      public static <T> org.apache.hadoop.hdfs.NameNodeProxiesClient.ProxyAndInfo<T> createProxy(org.apache.hadoop.conf.Configuration conf, URI nameNodeUri, Class<T> xface, AtomicBoolean fallbackToSimpleAuth) throws IOException
      Creates the namenode proxy with the passed protocol. This will handle creation of either HA- or non-HA-enabled proxy objects, depending upon if the provided URI is a configured logical URI.
      Parameters:
      conf - the configuration containing the required IPC properties, client failover configurations, etc.
      nameNodeUri - the URI pointing either to a specific NameNode or to a logical nameservice.
      xface - the IPC interface which should be created
      fallbackToSimpleAuth - set to true or false during calls to indicate if a secure client falls back to simple auth
      Returns:
      an object containing both the proxy and the associated delegation token service it corresponds to
      Throws:
      IOException - if there is an error creating the proxy
    • createNonHAProxy

      public static <T> org.apache.hadoop.hdfs.NameNodeProxiesClient.ProxyAndInfo<T> createNonHAProxy(org.apache.hadoop.conf.Configuration conf, InetSocketAddress nnAddr, Class<T> xface, org.apache.hadoop.security.UserGroupInformation ugi, boolean withRetries) throws IOException
      Creates an explicitly non-HA-enabled proxy object. Most of the time you don't want to use this, and should instead use createProxy(org.apache.hadoop.conf.Configuration, java.net.URI, java.lang.Class<T>).
      Parameters:
      conf - the configuration object
      nnAddr - address of the remote NN to connect to
      xface - the IPC interface which should be created
      ugi - the user who is making the calls on the proxy object
      withRetries - certain interfaces have a non-standard retry policy
      Returns:
      an object containing both the proxy and the associated delegation token service it corresponds to
      Throws:
      IOException
    • createNonHAProxy

      public static <T> org.apache.hadoop.hdfs.NameNodeProxiesClient.ProxyAndInfo<T> createNonHAProxy(org.apache.hadoop.conf.Configuration conf, InetSocketAddress nnAddr, Class<T> xface, org.apache.hadoop.security.UserGroupInformation ugi, boolean withRetries, AtomicBoolean fallbackToSimpleAuth, org.apache.hadoop.ipc.AlignmentContext alignmentContext) throws IOException
      Creates an explicitly non-HA-enabled proxy object. Most of the time you don't want to use this, and should instead use createProxy(org.apache.hadoop.conf.Configuration, java.net.URI, java.lang.Class<T>).
      Parameters:
      conf - the configuration object
      nnAddr - address of the remote NN to connect to
      xface - the IPC interface which should be created
      ugi - the user who is making the calls on the proxy object
      withRetries - certain interfaces have a non-standard retry policy
      fallbackToSimpleAuth - - set to true or false during this method to indicate if a secure client falls back to simple auth
      Returns:
      an object containing both the proxy and the associated delegation token service it corresponds to
      Throws:
      IOException