org.apache.hadoop.hdfs.server.namenode.ha
Class IPFailoverProxyProvider<T>

java.lang.Object
  extended by org.apache.hadoop.hdfs.server.namenode.ha.AbstractNNFailoverProxyProvider<T>
      extended by org.apache.hadoop.hdfs.server.namenode.ha.IPFailoverProxyProvider<T>
All Implemented Interfaces:
Closeable, org.apache.hadoop.io.retry.FailoverProxyProvider<T>

public class IPFailoverProxyProvider<T>
extends AbstractNNFailoverProxyProvider<T>

A NNFailoverProxyProvider implementation which works on IP failover setup. Only one proxy is used to connect to both servers and switching between the servers is done by the environment/infrastructure, which guarantees clients can consistently reach only one node at a time. Clients with a live connection will likely get connection reset after an IP failover. This case will be handled by the FailoverOnNetworkExceptionRetry retry policy. I.e. if the call is not idempotent, it won't get retried. A connection reset while setting up a connection (i.e. before sending a request) will be handled in ipc client. The namenode URI must contain a resolvable host name.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.io.retry.FailoverProxyProvider
org.apache.hadoop.io.retry.FailoverProxyProvider.ProxyInfo<T>
 
Field Summary
 
Fields inherited from class org.apache.hadoop.hdfs.server.namenode.ha.AbstractNNFailoverProxyProvider
fallbackToSimpleAuth
 
Constructor Summary
IPFailoverProxyProvider(org.apache.hadoop.conf.Configuration conf, URI uri, Class<T> xface)
           
 
Method Summary
 void close()
          Close the proxy,
 Class<T> getInterface()
           
 org.apache.hadoop.io.retry.FailoverProxyProvider.ProxyInfo<T> getProxy()
           
 void performFailover(T currentProxy)
          Nothing to do for IP failover
 boolean useLogicalURI()
          Logical URI is not used for IP failover.
 
Methods inherited from class org.apache.hadoop.hdfs.server.namenode.ha.AbstractNNFailoverProxyProvider
setFallbackToSimpleAuth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IPFailoverProxyProvider

public IPFailoverProxyProvider(org.apache.hadoop.conf.Configuration conf,
                               URI uri,
                               Class<T> xface)
Method Detail

getInterface

public Class<T> getInterface()

getProxy

public org.apache.hadoop.io.retry.FailoverProxyProvider.ProxyInfo<T> getProxy()

performFailover

public void performFailover(T currentProxy)
Nothing to do for IP failover


close

public void close()
           throws IOException
Close the proxy,

Throws:
IOException

useLogicalURI

public boolean useLogicalURI()
Logical URI is not used for IP failover.

Specified by:
useLogicalURI in class AbstractNNFailoverProxyProvider<T>
Returns:
true if logical HA URI is used. false, if not used.


Copyright © 2014 Apache Software Foundation. All Rights Reserved.