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

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

public class ConfiguredFailoverProxyProvider<T>
extends AbstractNNFailoverProxyProvider<T>

A FailoverProxyProvider implementation which allows one to configure two URIs to connect to during fail-over. The first configured address is tried first, and on a fail-over event the other address is tried.


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
ConfiguredFailoverProxyProvider(org.apache.hadoop.conf.Configuration conf, URI uri, Class<T> xface)
           
 
Method Summary
 void close()
          Close all the proxy objects which have been opened over the lifetime of this proxy provider.
 Class<T> getInterface()
           
 org.apache.hadoop.io.retry.FailoverProxyProvider.ProxyInfo<T> getProxy()
          Lazily initialize the RPC proxy object.
 void performFailover(T currentProxy)
           
 boolean useLogicalURI()
          Logical URI is required for this failover proxy provider.
 
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

ConfiguredFailoverProxyProvider

public ConfiguredFailoverProxyProvider(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()
Lazily initialize the RPC proxy object.


performFailover

public void performFailover(T currentProxy)

close

public void close()
           throws IOException
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:
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.