Class RequestHedgingProxyProvider<T>
java.lang.Object
org.apache.hadoop.hdfs.server.namenode.ha.AbstractNNFailoverProxyProvider<T>
org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider<T>
org.apache.hadoop.hdfs.server.namenode.ha.RequestHedgingProxyProvider<T>
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.io.retry.FailoverProxyProvider<T>
A FailoverProxyProvider implementation that technically does not "failover"
per-se. It constructs a wrapper proxy that sends the request to ALL
underlying proxies simultaneously. It assumes the in an HA setup, there will
be only one Active, and the active should respond faster than any configured
standbys. Once it receive a response from any one of the configured proxies,
outstanding requests to other proxies are immediately cancelled.
-
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
FieldsFields inherited from class org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider
proxiesFields inherited from class org.apache.hadoop.hdfs.server.namenode.ha.AbstractNNFailoverProxyProvider
conf, factory, fallbackToSimpleAuth, ugi, xface -
Constructor Summary
ConstructorsConstructorDescriptionRequestHedgingProxyProvider(org.apache.hadoop.conf.Configuration conf, URI uri, Class<T> xface, HAProxyFactory<T> proxyFactory) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.io.retry.FailoverProxyProvider.ProxyInfo<T>getProxy()Lazily initialize the RPC proxy object.voidperformFailover(T currentProxy) Methods inherited from class org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider
close, useLogicalURIMethods inherited from class org.apache.hadoop.hdfs.server.namenode.ha.AbstractNNFailoverProxyProvider
createProxyIfNeeded, getFallbackToSimpleAuth, getInterface, getProxyAddresses, getRandomOrder, setFallbackToSimpleAuth
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG
-
-
Constructor Details
-
RequestHedgingProxyProvider
public RequestHedgingProxyProvider(org.apache.hadoop.conf.Configuration conf, URI uri, Class<T> xface, HAProxyFactory<T> proxyFactory)
-
-
Method Details
-
getProxy
Description copied from class:ConfiguredFailoverProxyProviderLazily initialize the RPC proxy object.- Specified by:
getProxyin interfaceorg.apache.hadoop.io.retry.FailoverProxyProvider<T>- Overrides:
getProxyin classConfiguredFailoverProxyProvider<T>
-
performFailover
- Specified by:
performFailoverin interfaceorg.apache.hadoop.io.retry.FailoverProxyProvider<T>- Overrides:
performFailoverin classConfiguredFailoverProxyProvider<T>
-