@Private
public class NameNodeProxiesClient
extends java.lang.Object
ClientProtocol and
HAServiceProtocol to communicate with a remote NN. For the former,
generally use createProxyWithClientProtocol(
Configuration, URI, AtomicBoolean), which will create either an HA- or
non-HA-enabled client proxy as appropriate.
For creating proxy objects with other protocols, please see
NameNodeProxies#createProxy(Configuration, URI, Class).| Modifier and Type | Class | Description |
|---|---|---|
static class |
NameNodeProxiesClient.ProxyAndInfo<PROXYTYPE> |
Wrapper for a client proxy as well as its associated service ID.
|
| Constructor | Description |
|---|---|
NameNodeProxiesClient() |
| Modifier and Type | Method | Description |
|---|---|---|
static <T> AbstractNNFailoverProxyProvider<T> |
createFailoverProxyProvider(org.apache.hadoop.conf.Configuration conf,
java.net.URI nameNodeUri,
java.lang.Class<T> xface,
boolean checkPort,
java.util.concurrent.atomic.AtomicBoolean fallbackToSimpleAuth) |
Creates the Failover proxy provider instance
|
protected static <T> AbstractNNFailoverProxyProvider<T> |
createFailoverProxyProvider(org.apache.hadoop.conf.Configuration conf,
java.net.URI nameNodeUri,
java.lang.Class<T> xface,
boolean checkPort,
java.util.concurrent.atomic.AtomicBoolean fallbackToSimpleAuth,
HAProxyFactory<T> proxyFactory) |
|
static <T> NameNodeProxiesClient.ProxyAndInfo<T> |
createHAProxy(org.apache.hadoop.conf.Configuration conf,
java.net.URI nameNodeUri,
java.lang.Class<T> xface,
AbstractNNFailoverProxyProvider<T> failoverProxyProvider) |
Creates an explicitly HA-enabled proxy object.
|
static ClientProtocol |
createNonHAProxyWithClientProtocol(java.net.InetSocketAddress address,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.security.UserGroupInformation ugi,
boolean withRetries,
java.util.concurrent.atomic.AtomicBoolean fallbackToSimpleAuth) |
|
static ClientProtocol |
createProxyWithAlignmentContext(java.net.InetSocketAddress address,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.security.UserGroupInformation ugi,
boolean withRetries,
java.util.concurrent.atomic.AtomicBoolean fallbackToSimpleAuth,
org.apache.hadoop.ipc.AlignmentContext alignmentContext) |
|
static NameNodeProxiesClient.ProxyAndInfo<ClientProtocol> |
createProxyWithClientProtocol(org.apache.hadoop.conf.Configuration conf,
java.net.URI nameNodeUri,
java.util.concurrent.atomic.AtomicBoolean fallbackToSimpleAuth) |
Creates the namenode proxy with the ClientProtocol.
|
static <T> NameNodeProxiesClient.ProxyAndInfo<T> |
createProxyWithLossyRetryHandler(org.apache.hadoop.conf.Configuration config,
java.net.URI nameNodeUri,
java.lang.Class<T> xface,
int numResponseToDrop,
java.util.concurrent.atomic.AtomicBoolean fallbackToSimpleAuth) |
Generate a dummy namenode proxy instance that utilizes our hacked
LossyRetryInvocationHandler. |
static <T> java.lang.Class<org.apache.hadoop.io.retry.FailoverProxyProvider<T>> |
getFailoverProxyProviderClass(org.apache.hadoop.conf.Configuration conf,
java.net.URI nameNodeUri) |
Gets the configured Failover proxy provider's class
|
public static NameNodeProxiesClient.ProxyAndInfo<ClientProtocol> createProxyWithClientProtocol(org.apache.hadoop.conf.Configuration conf, java.net.URI nameNodeUri, java.util.concurrent.atomic.AtomicBoolean fallbackToSimpleAuth) throws java.io.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.fallbackToSimpleAuth - set to true or false during calls to indicate
if a secure client falls back to simple authjava.io.IOException - if there is an error creating the proxypublic static <T> NameNodeProxiesClient.ProxyAndInfo<T> createProxyWithLossyRetryHandler(org.apache.hadoop.conf.Configuration config, java.net.URI nameNodeUri, java.lang.Class<T> xface, int numResponseToDrop, java.util.concurrent.atomic.AtomicBoolean fallbackToSimpleAuth) throws java.io.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 authjava.io.IOException - if there is an error creating the proxy@VisibleForTesting public static <T> AbstractNNFailoverProxyProvider<T> createFailoverProxyProvider(org.apache.hadoop.conf.Configuration conf, java.net.URI nameNodeUri, java.lang.Class<T> xface, boolean checkPort, java.util.concurrent.atomic.AtomicBoolean fallbackToSimpleAuth) throws java.io.IOException
java.io.IOExceptionprotected static <T> AbstractNNFailoverProxyProvider<T> createFailoverProxyProvider(org.apache.hadoop.conf.Configuration conf, java.net.URI nameNodeUri, java.lang.Class<T> xface, boolean checkPort, java.util.concurrent.atomic.AtomicBoolean fallbackToSimpleAuth, HAProxyFactory<T> proxyFactory) throws java.io.IOException
java.io.IOException@VisibleForTesting
public static <T> java.lang.Class<org.apache.hadoop.io.retry.FailoverProxyProvider<T>> getFailoverProxyProviderClass(org.apache.hadoop.conf.Configuration conf,
java.net.URI nameNodeUri)
throws java.io.IOException
java.io.IOExceptionpublic static <T> NameNodeProxiesClient.ProxyAndInfo<T> createHAProxy(org.apache.hadoop.conf.Configuration conf, java.net.URI nameNodeUri, java.lang.Class<T> xface, AbstractNNFailoverProxyProvider<T> failoverProxyProvider)
conf - the configuration objectnameNodeUri - the URI pointing either to a specific NameNode or to a
logical nameservice.xface - the IPC interface which should be createdfailoverProxyProvider - Failover proxy providerpublic static ClientProtocol createNonHAProxyWithClientProtocol(java.net.InetSocketAddress address, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.security.UserGroupInformation ugi, boolean withRetries, java.util.concurrent.atomic.AtomicBoolean fallbackToSimpleAuth) throws java.io.IOException
java.io.IOExceptionpublic static ClientProtocol createProxyWithAlignmentContext(java.net.InetSocketAddress address, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.security.UserGroupInformation ugi, boolean withRetries, java.util.concurrent.atomic.AtomicBoolean fallbackToSimpleAuth, org.apache.hadoop.ipc.AlignmentContext alignmentContext) throws java.io.IOException
java.io.IOExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.