Java 类org.apache.hadoop.io.retry.FailoverProxyProvider.ProxyInfo 实例源码

项目:hadoop-2.6.0-cdh5.4.3    文件:ConfiguredFailoverProxyProvider.java   
/**
 * Lazily initialize the RPC proxy object.
 */
@SuppressWarnings("unchecked")
@Override
public synchronized ProxyInfo<T> getProxy() {
  AddressRpcProxyPair<T> current = proxies.get(currentProxyIndex);
  if (current.jtHaDaemon == null) {
    try {
      current.jtHaDaemon = JobTrackerProxies.createNonHAProxy(conf,
          current.address, xface, ugi, false).getProxy();
    } catch (IOException e) {
      LOG.error("Failed to create RPC proxy to JobTracker HA Daemon", e);
      throw new RuntimeException(e);
    }
  }
  return new ProxyInfo<T>(current.jtHaDaemon, current.address.toString());
}
项目:hops    文件:RetryInvocationHandler.java   
synchronized ProxyInfo<T> getProxyInfo() {
  return proxyInfo;
}