Class ConfiguredFailoverProxyProvider<T>
java.lang.Object
org.apache.hadoop.hdfs.server.namenode.ha.AbstractNNFailoverProxyProvider<T>
org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider<T>
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.io.retry.FailoverProxyProvider<T>
- Direct Known Subclasses:
InMemoryAliasMapFailoverProxyProvider,RequestHedgingProxyProvider
A FailoverProxyProvider implementation which allows one to configure
multiple URIs to connect to during fail-over. A random configured address is
tried first, and on a fail-over event the other addresses are tried
sequentially in a random order.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hdfs.server.namenode.ha.AbstractNNFailoverProxyProvider
AbstractNNFailoverProxyProvider.NNProxyInfo<T>Nested classes/interfaces inherited from interface org.apache.hadoop.io.retry.FailoverProxyProvider
org.apache.hadoop.io.retry.FailoverProxyProvider.ProxyInfo<T extends Object> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<AbstractNNFailoverProxyProvider.NNProxyInfo<T>>Fields inherited from class org.apache.hadoop.hdfs.server.namenode.ha.AbstractNNFailoverProxyProvider
conf, factory, fallbackToSimpleAuth, LOG, ugi, xface -
Constructor Summary
ConstructorsConstructorDescriptionConfiguredFailoverProxyProvider(org.apache.hadoop.conf.Configuration conf, URI uri, Class<T> xface, HAProxyFactory<T> factory) ConfiguredFailoverProxyProvider(org.apache.hadoop.conf.Configuration conf, URI uri, Class<T> xface, HAProxyFactory<T> factory, String addressKey) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close all the proxy objects which have been opened over the lifetime of this proxy provider.org.apache.hadoop.io.retry.FailoverProxyProvider.ProxyInfo<T>getProxy()Lazily initialize the RPC proxy object.voidperformFailover(T currentProxy) booleanLogical URI is required for this failover proxy provider.Methods inherited from class org.apache.hadoop.hdfs.server.namenode.ha.AbstractNNFailoverProxyProvider
createProxyIfNeeded, getFallbackToSimpleAuth, getInterface, getProxyAddresses, getRandomOrder, setFallbackToSimpleAuth
-
Field Details
-
proxies
-
-
Constructor Details
-
ConfiguredFailoverProxyProvider
public ConfiguredFailoverProxyProvider(org.apache.hadoop.conf.Configuration conf, URI uri, Class<T> xface, HAProxyFactory<T> factory) -
ConfiguredFailoverProxyProvider
-
-
Method Details
-
getProxy
Lazily initialize the RPC proxy object. -
performFailover
-
close
Close all the proxy objects which have been opened over the lifetime of this proxy provider.- Throws:
IOException
-
useLogicalURI
public boolean useLogicalURI()Logical URI is required for this failover proxy provider.- Specified by:
useLogicalURIin classAbstractNNFailoverProxyProvider<T>- Returns:
- true if logical HA URI is used. false, if not used.
-