public class NameNodeProxies extends Object
createProxy(Configuration, URI, Class), which will
create either an HA- or non-HA-enabled client proxy as appropriate.| Modifier and Type | Class and Description |
|---|---|
static class |
NameNodeProxies.ProxyAndInfo<PROXYTYPE>
Wrapper for a client proxy as well as its associated service ID.
|
| Constructor and Description |
|---|
NameNodeProxies() |
| Modifier and Type | Method and Description |
|---|---|
static <T> AbstractNNFailoverProxyProvider<T> |
createFailoverProxyProvider(Configuration conf,
URI nameNodeUri,
Class<T> xface,
boolean checkPort,
AtomicBoolean fallbackToSimpleAuth)
Creates the Failover proxy provider instance
|
static <T> NameNodeProxies.ProxyAndInfo<T> |
createNonHAProxy(Configuration conf,
InetSocketAddress nnAddr,
Class<T> xface,
UserGroupInformation ugi,
boolean withRetries)
Creates an explicitly non-HA-enabled proxy object.
|
static <T> NameNodeProxies.ProxyAndInfo<T> |
createNonHAProxy(Configuration conf,
InetSocketAddress nnAddr,
Class<T> xface,
UserGroupInformation ugi,
boolean withRetries,
AtomicBoolean fallbackToSimpleAuth)
Creates an explicitly non-HA-enabled proxy object.
|
static <T> NameNodeProxies.ProxyAndInfo<T> |
createProxy(Configuration conf,
URI nameNodeUri,
Class<T> xface)
Creates the namenode proxy with the passed protocol.
|
static <T> NameNodeProxies.ProxyAndInfo<T> |
createProxy(Configuration conf,
URI nameNodeUri,
Class<T> xface,
AtomicBoolean fallbackToSimpleAuth)
Creates the namenode proxy with the passed protocol.
|
static <T> NameNodeProxies.ProxyAndInfo<T> |
createProxyWithLossyRetryHandler(Configuration config,
URI nameNodeUri,
Class<T> xface,
int numResponseToDrop,
AtomicBoolean fallbackToSimpleAuth)
Generate a dummy namenode proxy instance that utilizes our hacked
LossyRetryInvocationHandler. |
static <T> Class<org.apache.hadoop.io.retry.FailoverProxyProvider<T>> |
getFailoverProxyProviderClass(Configuration conf,
URI nameNodeUri)
Gets the configured Failover proxy provider's class
|
public NameNodeProxies()
public static <T> NameNodeProxies.ProxyAndInfo<T> createProxy(Configuration conf, URI nameNodeUri, Class<T> xface) throws IOException
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 createdIOException - if there is an error creating the proxypublic static <T> NameNodeProxies.ProxyAndInfo<T> createProxy(Configuration conf, URI nameNodeUri, Class<T> xface, AtomicBoolean fallbackToSimpleAuth) throws IOException
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 authIOException - if there is an error creating the proxypublic static <T> NameNodeProxies.ProxyAndInfo<T> createProxyWithLossyRetryHandler(Configuration config, URI nameNodeUri, Class<T> xface, int numResponseToDrop, AtomicBoolean fallbackToSimpleAuth) throws IOException
LossyRetryInvocationHandler. Proxy instance generated using this
method will proactively drop RPC responses. Currently this method only
support HA setup. null will be returned if the given configuration is not
for HA.config - 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 creatednumResponseToDrop - The number of responses to drop for each RPC callfallbackToSimpleAuth - set to true or false during calls to indicate if
a secure client falls back to simple authIOException - if there is an error creating the proxypublic static <T> NameNodeProxies.ProxyAndInfo<T> createNonHAProxy(Configuration conf, InetSocketAddress nnAddr, Class<T> xface, UserGroupInformation ugi, boolean withRetries) throws IOException
createProxy(org.apache.hadoop.conf.Configuration, java.net.URI, java.lang.Class<T>).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 policyIOExceptionpublic static <T> NameNodeProxies.ProxyAndInfo<T> createNonHAProxy(Configuration conf, InetSocketAddress nnAddr, Class<T> xface, UserGroupInformation ugi, boolean withRetries, AtomicBoolean fallbackToSimpleAuth) throws IOException
createProxy(org.apache.hadoop.conf.Configuration, java.net.URI, java.lang.Class<T>).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 authIOExceptionpublic static <T> Class<org.apache.hadoop.io.retry.FailoverProxyProvider<T>> getFailoverProxyProviderClass(Configuration conf, URI nameNodeUri) throws IOException
IOExceptionpublic static <T> AbstractNNFailoverProxyProvider<T> createFailoverProxyProvider(Configuration conf, URI nameNodeUri, Class<T> xface, boolean checkPort, AtomicBoolean fallbackToSimpleAuth) throws IOException
IOExceptionCopyright © 2018 CERN. All Rights Reserved.