java.io.Closeable, java.lang.AutoCloseable, org.apache.hadoop.io.retry.FailoverProxyProvider<T>ObserverReadProxyProviderWithIPFailover@Private @Evolving public class ObserverReadProxyProvider<T> extends AbstractNNFailoverProxyProvider<T>
FailoverProxyProvider implementation
that supports reading from observer namenode(s).
This constructs a wrapper proxy that sends the request to observer
namenode(s), if observer read is enabled. In case there are multiple
observer namenodes, it will try them one by one in case the RPC failed. It
will fail back to the active namenode after it has exhausted all the
observer namenodes.
Read and write requests will still be sent to active NN if reading from
observer is turned off.AbstractNNFailoverProxyProvider.NNProxyInfo<T>conf, factory, fallbackToSimpleAuth, ugi, xface| Constructor | Description |
|---|---|
ObserverReadProxyProvider(org.apache.hadoop.conf.Configuration conf,
java.net.URI uri,
java.lang.Class<T> xface,
HAProxyFactory<T> factory) |
By default ObserverReadProxyProvider uses
ConfiguredFailoverProxyProvider for failover. |
ObserverReadProxyProvider(org.apache.hadoop.conf.Configuration conf,
java.net.URI uri,
java.lang.Class<T> xface,
HAProxyFactory<T> factory,
AbstractNNFailoverProxyProvider<T> failoverProxy) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
|
org.apache.hadoop.ipc.AlignmentContext |
getAlignmentContext() |
|
org.apache.hadoop.io.retry.FailoverProxyProvider.ProxyInfo<T> |
getProxy() |
|
void |
performFailover(T currentProxy) |
|
boolean |
useLogicalURI() |
Inquire whether logical HA URI is used for the implementation.
|
createProxyIfNeeded, getFallbackToSimpleAuth, getInterface, getProxyAddresses, getRandomOrder, setFallbackToSimpleAuthpublic ObserverReadProxyProvider(org.apache.hadoop.conf.Configuration conf,
java.net.URI uri,
java.lang.Class<T> xface,
HAProxyFactory<T> factory)
ConfiguredFailoverProxyProvider for failover.public ObserverReadProxyProvider(org.apache.hadoop.conf.Configuration conf,
java.net.URI uri,
java.lang.Class<T> xface,
HAProxyFactory<T> factory,
AbstractNNFailoverProxyProvider<T> failoverProxy)
public org.apache.hadoop.ipc.AlignmentContext getAlignmentContext()
public org.apache.hadoop.io.retry.FailoverProxyProvider.ProxyInfo<T> getProxy()
public void performFailover(T currentProxy)
public void close()
throws java.io.IOException
java.io.IOExceptionpublic boolean useLogicalURI()
AbstractNNFailoverProxyProvideruseLogicalURI in class AbstractNNFailoverProxyProvider<T>Copyright © 2008–2025 Apache Software Foundation. All rights reserved.