webAppBuild.invoke(WebApps.$for("jobhistory", HistoryClientService.class, this, "ws").with(conf).withHttpSpnegoKeytabKey(XLearningConfiguration.XLEARNING_WEBAPP_SPNEGO_KEYTAB_FILE_KEY).withHttpSpnegoPrincipalKey(XLearningConfiguration.XLEARNING_WEBAPP_SPNEGO_USER_NAME_KEY).at(NetUtils.getHostPortString(bindAddress)), webApp); HttpServer2 httpServer = webApp.httpServer(); WebAppContext webAppContext = httpServer.getWebAppContext(); .withHttpSpnegoPrincipalKey( XLearningConfiguration.XLEARNING_WEBAPP_SPNEGO_USER_NAME_KEY) .at(NetUtils.getHostPortString(bindAddress)).start(webApp); } catch (WebAppException e){ throw new WebAppException("Error starting http server", e);
public static void main(String[] args) { WebApps.$for("test").at(8888).inDevMode().start().joinThread(); } }
public static void main(String[] args) throws Exception { WebApps.$for(new MyApp()).at(8888).inDevMode().start().joinThread(); } }
public static void main(String[] args) { WebApps.$for("test").at(8888).inDevMode().start().joinThread(); } }
public static void main(String[] args) { WebApps.$for("test").at(8888).inDevMode().start().joinThread(); } }
@Test(expected=org.apache.hadoop.yarn.webapp.WebAppException.class) public void testCreateWithNonZeroPort() { WebApp app = WebApps.$for(this).at(50000).start(); int port = app.getListenerAddress().getPort(); assertEquals(50000, port); // start another WebApp with same NonZero port WebApp app2 = WebApps.$for(this).at(50000).start(); // An exception occurs (findPort disabled) app.stop(); app2.stop(); }
public static void main(String[] args) throws Exception { // For manual testing WebApps.$for("yarn", new TestRMWebApp()).at(8888).inDevMode(). start(new RMWebApp(mockRm(2500, 8, 8, 8*GiB))).joinThread(); WebApps.$for("yarn", new TestRMWebApp()).at(8888).inDevMode(). start(new RMWebApp(mockFifoRm(10, 1, 4, 8*GiB))).joinThread(); } }
@VisibleForTesting public void startWepApp() { RMWebAppUtil.setupSecurityAndFilters(conf, null); Builder<Object> builder = WebApps.$for("cluster", null, null, "ws").with(conf).at(webAppAddress); webApp = builder.start(new RouterWebApp(this)); }
public static void main(String[] args) throws Exception { // For manual testing WebApps.$for("yarn", new TestRMWebApp()).at(8888).inDevMode(). start(new RMWebApp(mockRm(2500, 8, 8, 8*GiB))).joinThread(); WebApps.$for("yarn", new TestRMWebApp()).at(8888).inDevMode(). start(new RMWebApp(mockFifoRm(10, 1, 4, 8*GiB))).joinThread(); } }
@Test(expected=org.apache.hadoop.yarn.webapp.WebAppException.class) public void testCreateWithNonZeroPort() { WebApp app = WebApps.$for(this).at(50000).start(); int port = app.getListenerAddress().getPort(); assertEquals(50000, port); // start another WebApp with same NonZero port WebApp app2 = WebApps.$for(this).at(50000).start(); // An exception occurs (findPort disabled) app.stop(); app2.stop(); }
@Test(expected=org.apache.hadoop.yarn.webapp.WebAppException.class) public void testCreateWithNonZeroPort() { WebApp app = WebApps.$for(this).at(50000).start(); int port = app.getListenerAddress().getPort(); assertEquals(50000, port); // start another WebApp with same NonZero port WebApp app2 = WebApps.$for(this).at(50000).start(); // An exception occurs (findPort disabled) app.stop(); app2.stop(); }
@Test(expected=org.apache.hadoop.yarn.webapp.WebAppException.class) public void testCreateWithBindAddressNonZeroPort() { WebApp app = WebApps.$for(this).at("0.0.0.0:50000").start(); int port = app.getListenerAddress().getPort(); assertEquals(50000, port); // start another WebApp with same NonZero port WebApp app2 = WebApps.$for(this).at("0.0.0.0:50000").start(); // An exception occurs (findPort disabled) app.stop(); app2.stop(); }
@Test(expected=org.apache.hadoop.yarn.webapp.WebAppException.class) public void testCreateWithBindAddressNonZeroPort() { WebApp app = WebApps.$for(this).at("0.0.0.0:50000").start(); int port = app.getListenerAddress().getPort(); assertEquals(50000, port); // start another WebApp with same NonZero port WebApp app2 = WebApps.$for(this).at("0.0.0.0:50000").start(); // An exception occurs (findPort disabled) app.stop(); app2.stop(); }
@Test(expected=org.apache.hadoop.yarn.webapp.WebAppException.class) public void testCreateWithBindAddressNonZeroPort() { WebApp app = WebApps.$for(this).at("0.0.0.0:50000").start(); int port = app.getListenerAddress().getPort(); assertEquals(50000, port); // start another WebApp with same NonZero port WebApp app2 = WebApps.$for(this).at("0.0.0.0:50000").start(); // An exception occurs (findPort disabled) app.stop(); app2.stop(); }
@Test public void testCreateWithPort() { // see if the ephemeral port is updated WebApp app = WebApps.$for(this).at(0).start(); int port = app.getListenerAddress().getPort(); assertTrue(port > 0); app.stop(); // try to reuse the port app = WebApps.$for(this).at(port).start(); assertEquals(port, app.getListenerAddress().getPort()); app.stop(); }
public static void main(String[] args) { WebApps.$for("yarn", AppContext.class, new MockAppContext(0, 8, 88, 4)). at(58888).inDevMode().start(new AMWebApp()).joinThread(); } }
@Test public void testCreateWithPort() { // see if the ephemeral port is updated WebApp app = WebApps.$for(this).at(0).start(); int port = app.getListenerAddress().getPort(); assertTrue(port > 0); app.stop(); // try to reuse the port app = WebApps.$for(this).at(port).start(); assertEquals(port, app.getListenerAddress().getPort()); app.stop(); }