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> FailoverProxyProvider<T> |
createFailoverProxyProvider(Configuration conf,
Class<FailoverProxyProvider<T>> failoverProxyProviderClass,
Class<T> xface,
URI nameNodeUri)
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> |
createProxy(Configuration conf,
URI nameNodeUri,
Class<T> xface)
Creates the namenode proxy with the passed protocol.
|
static <T> NameNodeProxies.ProxyAndInfo<T> |
createProxyWithLossyRetryHandler(Configuration config,
URI nameNodeUri,
Class<T> xface,
int numResponseToDrop)
Generate a dummy namenode proxy instance that utilizes our hacked
LossyRetryInvocationHandler . |
static <T> Class<FailoverProxyProvider<T>> |
getFailoverProxyProviderClass(Configuration conf,
URI nameNodeUri,
Class<T> xface)
Gets the configured Failover proxy provider's class
|
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> createProxyWithLossyRetryHandler(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(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 policyIOException
public static <T> Class<FailoverProxyProvider<T>> getFailoverProxyProviderClass(Configuration conf, URI nameNodeUri, Class<T> xface) throws IOException
IOException
public static <T> FailoverProxyProvider<T> createFailoverProxyProvider(Configuration conf, Class<FailoverProxyProvider<T>> failoverProxyProviderClass, Class<T> xface, URI nameNodeUri) throws IOException
IOException
Copyright © 2013 Apache Software Foundation. All rights reserved.