private NamenodeProtocol getActiveNodeProxy() throws IOException { if (cachedActiveProxy == null) { while (true) { // if we have reached the max loop count, quit by returning null if ((nnLoopCount / nnCount) >= maxRetries) { return null; } currentNN = nnLookup.next(); try { int rpcTimeout = conf.getInt( DFSConfigKeys.DFS_HA_LOGROLL_RPC_TIMEOUT_KEY, DFSConfigKeys.DFS_HA_LOGROLL_RPC_TIMEOUT_DEFAULT); NamenodeProtocolPB proxy = RPC.waitForProxy(NamenodeProtocolPB.class, RPC.getProtocolVersion(NamenodeProtocolPB.class), currentNN.getIpcAddress(), conf, rpcTimeout, Long.MAX_VALUE); cachedActiveProxy = new NamenodeProtocolTranslatorPB(proxy); break; } catch (IOException e) { LOG.info("Failed to reach " + currentNN, e); // couldn't even reach this NN, try the next one nnLoopCount++; } } } assert cachedActiveProxy != null; return cachedActiveProxy; } }
public Object run() throws IOException { return RPC.waitForProxy(InterTrackerProtocol.class, InterTrackerProtocol.versionID, jobTrackAddr, fConf); } });
public static VersionedProtocol waitForProxy(Class protocol, long clientVersion, InetSocketAddress addr, Configuration conf ) throws IOException { return waitForProxy(protocol, clientVersion, addr, conf, Long.MAX_VALUE); }
protected void initJobClient(JobConf conf) throws IOException { this.jobTrackAddr = JobTracker.getAddress(conf); this.jobClient = (InterTrackerProtocol) RPC.waitForProxy(InterTrackerProtocol.class, InterTrackerProtocol.versionID, jobTrackAddr,conf); }
public void testStandaloneClient() throws IOException { try { RPC.waitForProxy(TestProtocol.class, TestProtocol.versionID, new InetSocketAddress(ADDRESS, 20), conf, 15000L); fail("We should not have reached here"); } catch (ConnectException ioe) { //this is what we expected } }
private NamenodeProtocol getActiveNodeProxy() throws IOException { if (cachedActiveProxy == null) { int rpcTimeout = conf.getInt( DFSConfigKeys.DFS_HA_LOGROLL_RPC_TIMEOUT_KEY, DFSConfigKeys.DFS_HA_LOGROLL_RPC_TIMEOUT_DEFAULT); NamenodeProtocolPB proxy = RPC.waitForProxy(NamenodeProtocolPB.class, RPC.getProtocolVersion(NamenodeProtocolPB.class), activeAddr, conf, rpcTimeout, Long.MAX_VALUE); cachedActiveProxy = new NamenodeProtocolTranslatorPB(proxy); } assert cachedActiveProxy != null; return cachedActiveProxy; }
private NamenodeProtocol getActiveNodeProxy() throws IOException { if (cachedActiveProxy == null) { int rpcTimeout = conf.getInt( DFSConfigKeys.DFS_HA_LOGROLL_RPC_TIMEOUT_KEY, DFSConfigKeys.DFS_HA_LOGROLL_RPC_TIMEOUT_DEFAULT); NamenodeProtocolPB proxy = RPC.waitForProxy(NamenodeProtocolPB.class, RPC.getProtocolVersion(NamenodeProtocolPB.class), activeAddr, conf, rpcTimeout, Long.MAX_VALUE); cachedActiveProxy = new NamenodeProtocolTranslatorPB(proxy); } assert cachedActiveProxy != null; return cachedActiveProxy; }
public static DirectTaskUmbilical createDirectUmbilical( TaskUmbilicalProtocol taskTracker, InetSocketAddress jobTrackerAddress, JobConf conf) throws IOException { LOG.info("Creating direct umbilical to " + jobTrackerAddress.toString()); long jtConnectTimeoutMsec = conf.getLong( "corona.jobtracker.connect.timeout.msec", 60000L); int rpcTimeout = (int) jtConnectTimeoutMsec; InterTrackerProtocol jobClient = RPC.waitForProxy( InterTrackerProtocol.class, InterTrackerProtocol.versionID, jobTrackerAddress, conf, jtConnectTimeoutMsec, rpcTimeout); return new DirectTaskUmbilical(taskTracker, jobClient); }
@Override public void run() { try { Configuration config = new Configuration(conf); config.setInt(IPC_CLIENT_CONNECT_MAX_RETRIES_KEY, connectRetries); config.setInt( IPC_CLIENT_CONNECT_MAX_RETRIES_ON_SOCKET_TIMEOUTS_KEY, connectRetries); waitStarted = true; TestProtocol proxy = RPC.waitForProxy(TestProtocol.class, TestProtocol.versionID, new InetSocketAddress(ADDRESS, 20), config, 15000L); proxy.echo(""); } catch (Throwable throwable) { caught = throwable; } }
@Override public void run() { try { Configuration config = new Configuration(conf); config.setInt(IPC_CLIENT_CONNECT_MAX_RETRIES_KEY, connectRetries); config.setInt( IPC_CLIENT_CONNECT_MAX_RETRIES_ON_SOCKET_TIMEOUTS_KEY, connectRetries); waitStarted = true; TestProtocol proxy = RPC.waitForProxy(TestProtocol.class, TestProtocol.versionID, new InetSocketAddress(ADDRESS, 20), config, 15000L); proxy.echo(""); } catch (Throwable throwable) { caught = throwable; } }
@Test public void testStandaloneClient() throws IOException { try { TestProtocol proxy = RPC.waitForProxy(TestProtocol.class, TestProtocol.versionID, new InetSocketAddress(ADDRESS, 20), conf, 15000L); proxy.echo(""); fail("We should not have reached here"); } catch (ConnectException ioe) { //this is what we expected } }
@Test public void testStandaloneClient() throws IOException { try { TestProtocol proxy = RPC.waitForProxy(TestProtocol.class, TestProtocol.versionID, new InetSocketAddress(ADDRESS, 20), conf, 15000L); proxy.echo(""); fail("We should not have reached here"); } catch (ConnectException ioe) { //this is what we expected } }
void setupNS(Configuration conf, AbstractList<File> dataDirs) throws IOException { // get NN proxy DatanodeProtocol dnp = (DatanodeProtocol)RPC.waitForProxy(DatanodeProtocol.class, DatanodeProtocol.versionID, nnAddr, conf); setNameNode(dnp); // handshake with NN NamespaceInfo nsInfo = handshake(); setNamespaceInfo(nsInfo); synchronized(DataNode.this){ setupNSStorage(); } nsRegistration.setIpcPort(ipcServer.getListenerAddress().getPort()); nsRegistration.setInfoPort(infoServer.getPort()); }
(NamenodeProtocol) RPC.waitForProxy(NamenodeProtocol.class, NamenodeProtocol.versionID, nameNodeAddr, conf);
(NamenodeProtocol) RPC.waitForProxy(NamenodeProtocol.class, NamenodeProtocol.versionID, nameNodeAddr, conf);
RPC.waitForProxy(DatanodeProtocol.class, DatanodeProtocol.versionID, nameNodeAddr,
RPC.waitForProxy(DatanodeProtocol.class, DatanodeProtocol.versionID, nameNodeAddr,
RPC.waitForProxy(InterTrackerProtocol.class, InterTrackerProtocol.versionID, jobTrackAddr, this.fConf);