@Test public void testPbRecordFactory() { RecordFactory pbRecordFactory = RecordFactoryPBImpl.get(); try { NodeHeartbeatRequest request = pbRecordFactory.newRecordInstance(NodeHeartbeatRequest.class); Assert.assertEquals(NodeHeartbeatRequestPBImpl.class, request.getClass()); } catch (YarnRuntimeException e) { e.printStackTrace(); Assert.fail("Failed to crete record"); } }
@Test public void testPbRecordFactory() { RecordFactory pbRecordFactory = RecordFactoryPBImpl.get(); try { AllocateResponse response = pbRecordFactory.newRecordInstance(AllocateResponse.class); Assert.assertEquals(AllocateResponsePBImpl.class, response.getClass()); } catch (YarnRuntimeException e) { e.printStackTrace(); Assert.fail("Failed to crete record"); } try { AllocateRequest response = pbRecordFactory.newRecordInstance(AllocateRequest.class); Assert.assertEquals(AllocateRequestPBImpl.class, response.getClass()); } catch (YarnRuntimeException e) { e.printStackTrace(); Assert.fail("Failed to crete record"); } }
@Test public void testPbRecordFactory() { RecordFactory pbRecordFactory = RecordFactoryPBImpl.get(); try { AllocateResponse response = pbRecordFactory.newRecordInstance(AllocateResponse.class); Assert.assertEquals(AllocateResponsePBImpl.class, response.getClass()); } catch (YarnRuntimeException e) { e.printStackTrace(); Assert.fail("Failed to crete record"); } try { AllocateRequest response = pbRecordFactory.newRecordInstance(AllocateRequest.class); Assert.assertEquals(AllocateRequestPBImpl.class, response.getClass()); } catch (YarnRuntimeException e) { e.printStackTrace(); Assert.fail("Failed to crete record"); } }
private void testPbClientFactory() { InetSocketAddress addr = new InetSocketAddress(0); System.err.println(addr.getHostName() + addr.getPort()); Configuration conf = new Configuration(); ApplicationMasterProtocol instance = new AMRMProtocolTestImpl(); Server server = null; try { server = RpcServerFactoryPBImpl.get().getServer( ApplicationMasterProtocol.class, instance, addr, conf, null, 1); server.start(); System.err.println(server.getListenerAddress()); System.err.println(NetUtils.getConnectAddress(server)); ApplicationMasterProtocol amrmClient = null; try { amrmClient = (ApplicationMasterProtocol) RpcClientFactoryPBImpl.get().getClient(ApplicationMasterProtocol.class, 1, NetUtils.getConnectAddress(server), conf); } catch (YarnRuntimeException e) { e.printStackTrace(); Assert.fail("Failed to create client"); } } catch (YarnRuntimeException e) { e.printStackTrace(); Assert.fail("Failed to create server"); } finally { if (server != null) { server.stop(); } } }
@Test public void testPbRecordFactory() { RecordFactory pbRecordFactory = RecordFactoryPBImpl.get(); try { AllocateResponse response = pbRecordFactory.newRecordInstance(AllocateResponse.class); Assert.assertEquals(AllocateResponsePBImpl.class, response.getClass()); } catch (YarnRuntimeException e) { e.printStackTrace(); Assert.fail("Failed to crete record"); } try { AllocateRequest response = pbRecordFactory.newRecordInstance(AllocateRequest.class); Assert.assertEquals(AllocateRequestPBImpl.class, response.getClass()); } catch (YarnRuntimeException e) { e.printStackTrace(); Assert.fail("Failed to crete record"); } }
private void testPbServerFactory() { InetSocketAddress addr = new InetSocketAddress(0); Configuration conf = new Configuration(); ApplicationMasterProtocol instance = new AMRMProtocolTestImpl(); Server server = null; try { server = RpcServerFactoryPBImpl.get().getServer( ApplicationMasterProtocol.class, instance, addr, conf, null, 1); server.start(); } catch (YarnRuntimeException e) { e.printStackTrace(); Assert.fail("Failed to create server"); } finally { if (server != null) { server.stop(); } } }
private void testPbServerFactory() { InetSocketAddress addr = new InetSocketAddress(0); Configuration conf = new Configuration(); ApplicationMasterProtocol instance = new AMRMProtocolTestImpl(); Server server = null; try { server = RpcServerFactoryPBImpl.get().getServer( ApplicationMasterProtocol.class, instance, addr, conf, null, 1); server.start(); } catch (YarnRuntimeException e) { e.printStackTrace(); Assert.fail("Failed to create server"); } finally { if (server != null) { server.stop(); } } }
private void testPbServerFactory() { InetSocketAddress addr = new InetSocketAddress(0); Configuration conf = new Configuration(); ResourceTracker instance = new ResourceTrackerTestImpl(); Server server = null; try { server = RpcServerFactoryPBImpl.get().getServer( ResourceTracker.class, instance, addr, conf, null, 1); server.start(); } catch (YarnRuntimeException e) { e.printStackTrace(); Assert.fail("Failed to create server"); } finally { server.stop(); } }
private void testPbClientFactory() { InetSocketAddress addr = new InetSocketAddress(0); System.err.println(addr.getHostName() + addr.getPort()); Configuration conf = new Configuration(); ResourceTracker instance = new ResourceTrackerTestImpl(); Server server = null; try { server = RpcServerFactoryPBImpl.get().getServer( ResourceTracker.class, instance, addr, conf, null, 1); server.start(); System.err.println(server.getListenerAddress()); System.err.println(NetUtils.getConnectAddress(server)); ResourceTracker client = null; try { client = (ResourceTracker) RpcClientFactoryPBImpl.get().getClient(ResourceTracker.class, 1, NetUtils.getConnectAddress(server), conf); } catch (YarnRuntimeException e) { e.printStackTrace(); Assert.fail("Failed to create client"); } } catch (YarnRuntimeException e) { e.printStackTrace(); Assert.fail("Failed to create server"); } finally { server.stop(); } }
private void testPbClientFactory() { InetSocketAddress addr = new InetSocketAddress(0); System.err.println(addr.getHostName() + addr.getPort()); Configuration conf = new Configuration(); ApplicationMasterProtocol instance = new AMRMProtocolTestImpl(); Server server = null; try { server = RpcServerFactoryPBImpl.get().getServer( ApplicationMasterProtocol.class, instance, addr, conf, null, 1); server.start(); System.err.println(server.getListenerAddress()); System.err.println(NetUtils.getConnectAddress(server)); ApplicationMasterProtocol amrmClient = null; try { amrmClient = (ApplicationMasterProtocol) RpcClientFactoryPBImpl.get().getClient(ApplicationMasterProtocol.class, 1, NetUtils.getConnectAddress(server), conf); } catch (YarnRuntimeException e) { e.printStackTrace(); Assert.fail("Failed to create client"); } } catch (YarnRuntimeException e) { e.printStackTrace(); Assert.fail("Failed to create server"); } finally { if (server != null) { server.stop(); } } }
private void testPbClientFactory() { InetSocketAddress addr = new InetSocketAddress(0); System.err.println(addr.getHostName() + addr.getPort()); Configuration conf = new Configuration(); ApplicationMasterProtocol instance = new AMRMProtocolTestImpl(); Server server = null; try { server = RpcServerFactoryPBImpl.get().getServer( ApplicationMasterProtocol.class, instance, addr, conf, null, 1); server.start(); System.err.println(server.getListenerAddress()); System.err.println(NetUtils.getConnectAddress(server)); ApplicationMasterProtocol amrmClient = null; try { amrmClient = (ApplicationMasterProtocol) RpcClientFactoryPBImpl.get().getClient(ApplicationMasterProtocol.class, 1, NetUtils.getConnectAddress(server), conf); } catch (YarnRuntimeException e) { e.printStackTrace(); Assert.fail("Failed to create client"); } } catch (YarnRuntimeException e) { e.printStackTrace(); Assert.fail("Failed to create server"); } finally { if (server != null) { server.stop(); } } }
private void testPbServerFactory() { InetSocketAddress addr = new InetSocketAddress(0); Configuration conf = new Configuration(); ApplicationMasterProtocol instance = new AMRMProtocolTestImpl(); Server server = null; try { server = RpcServerFactoryPBImpl.get().getServer( ApplicationMasterProtocol.class, instance, addr, conf, null, 1); server.start(); } catch (YarnRuntimeException e) { e.printStackTrace(); Assert.fail("Failed to create server"); } finally { if (server != null) { server.stop(); } } }