org.apache.hadoop.hdfs
Class NameNodeProxies
java.lang.Object
org.apache.hadoop.hdfs.NameNodeProxies
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.
|
Method Summary |
static
|
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
|
createProxy(org.apache.hadoop.conf.Configuration conf,
URI nameNodeUri,
Class<T> xface)
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 |
NameNodeProxies
public NameNodeProxies()
createProxy
public static <T> NameNodeProxies.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
createNonHAProxy
public static <T> NameNodeProxies.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).
- 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
Copyright © 2013 Apache Software Foundation. All Rights Reserved.