/** * 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()); }
synchronized ProxyInfo<T> getProxyInfo() { return proxyInfo; }