Package org.apache.hadoop.hdfs
Class NameNodeProxies
java.lang.Object
org.apache.hadoop.hdfs.NameNodeProxies
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic <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.
-
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 createdfallbackToSimpleAuth- 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 usecreateProxy(org.apache.hadoop.conf.Configuration, java.net.URI, java.lang.Class<T>).- Parameters:
conf- the configuration objectnnAddr- address of the remote NN to connect toxface- the IPC interface which should be createdugi- the user who is making the calls on the proxy objectwithRetries- 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 usecreateProxy(org.apache.hadoop.conf.Configuration, java.net.URI, java.lang.Class<T>).- Parameters:
conf- the configuration objectnnAddr- address of the remote NN to connect toxface- the IPC interface which should be createdugi- the user who is making the calls on the proxy objectwithRetries- certain interfaces have a non-standard retry policyfallbackToSimpleAuth- - 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
-