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

java.lang.Object
  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 Object
implements org.apache.hadoop.io.retry.FailoverProxyProvider<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.


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()
           
 T getProxy()
          Lazily initialize the RPC proxy object.
 void performFailover(T currentProxy)
           
 
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()
Specified by:
getInterface in interface org.apache.hadoop.io.retry.FailoverProxyProvider<T>

getProxy

public T getProxy()
Lazily initialize the RPC proxy object.

Specified by:
getProxy in interface org.apache.hadoop.io.retry.FailoverProxyProvider<T>

performFailover

public void performFailover(T currentProxy)
Specified by:
performFailover in interface org.apache.hadoop.io.retry.FailoverProxyProvider<T>

close

public void close()
           throws IOException
Close all the proxy objects which have been opened over the lifetime of this proxy provider.

Specified by:
close in interface Closeable
Throws:
IOException


Copyright © 2013 Apache Software Foundation. All Rights Reserved.