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> org.apache.hadoop.io.retry.FailoverProxyProvider<T> |
createFailoverProxyProvider(org.apache.hadoop.conf.Configuration conf,
Class<org.apache.hadoop.io.retry.FailoverProxyProvider<T>> failoverProxyProviderClass,
Class<T> xface,
URI nameNodeUri)
Creates the Failover proxy provider instance
|
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)
Creates an explicitly non-HA-enabled proxy object.
|
static <T> NameNodeProxies.ProxyAndInfo<T> |
createProxy(org.apache.hadoop.conf.Configuration conf,
URI nameNodeUri,
Class<T> xface)
Creates the namenode proxy with the passed protocol.
|
static <T> NameNodeProxies.ProxyAndInfo<T> |
createProxyWithLossyRetryHandler(org.apache.hadoop.conf.Configuration config,
URI nameNodeUri,
Class<T> xface,
int numResponseToDrop)
Generate a dummy namenode proxy instance that utilizes our hacked
LossyRetryInvocationHandler. |
static <T> Class<org.apache.hadoop.io.retry.FailoverProxyProvider<T>> |
getFailoverProxyProviderClass(org.apache.hadoop.conf.Configuration conf,
URI nameNodeUri,
Class<T> xface)
Gets the configured Failover proxy provider's class
|
public NameNodeProxies()
public static <T> NameNodeProxies.ProxyAndInfo<T> createProxy(org.apache.hadoop.conf.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> createProxyWithLossyRetryHandler(org.apache.hadoop.conf.Configuration config, URI nameNodeUri, Class<T> xface, int numResponseToDrop) 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 callIOException - if there is an error creating the proxypublic 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
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> Class<org.apache.hadoop.io.retry.FailoverProxyProvider<T>> getFailoverProxyProviderClass(org.apache.hadoop.conf.Configuration conf, URI nameNodeUri, Class<T> xface) throws IOException
IOExceptionpublic static <T> org.apache.hadoop.io.retry.FailoverProxyProvider<T> createFailoverProxyProvider(org.apache.hadoop.conf.Configuration conf, Class<org.apache.hadoop.io.retry.FailoverProxyProvider<T>> failoverProxyProviderClass, Class<T> xface, URI nameNodeUri) throws IOException
IOExceptionCopyright © 2014 Apache Software Foundation. All Rights Reserved.