try { Method webAppBuild = WebApps.Builder.class.getMethod("build", WebApp.class); webApp = (WebApp) webAppBuild.invoke(WebApps.$for("proxy", ApplicationContext.class, applicationContext, null).with(getConfig()), new AMWebApp()); HttpServer2 httpServer = webApp.httpServer(); webApp = WebApps.$for("proxy", ApplicationContext.class, applicationContext, null).with(getConfig()).start(new AMWebApp()); } catch (Exception e) { LOG.error("Error starting application web server!", e);
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(); LOG.debug("current hadoop version don't have the method build of Class " + WebApps.class.toString() + ". For More Detail: " + e); WebApps .$for("jobhistory", HistoryClientService.class, this, "ws") .with(conf) .withHttpSpnegoKeytabKey(
public static <T> Builder<T> $for(String prefix) { return $for(prefix, null, null); } }
public static <T> Builder<T> $for(String prefix) { return $for(prefix, null, null); } }
@SuppressWarnings("unchecked") public static <T> Builder<T> $for(String prefix, T app) { return $for(prefix, (Class<T>)app.getClass(), app); }
@SuppressWarnings("unchecked") public static <T> Builder<T> $for(String prefix, T app) { return $for(prefix, (Class<T>)app.getClass(), app); }
@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) { WebApps.$for(new HelloWorld()).at(8888).inDevMode().start().joinThread(); } }
public static void main(String[] args) { WebApps.$for(new HelloWorld()).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(new HelloWorld()).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) throws Exception { WebApps.$for(new MyApp()).at(8888).inDevMode().start().joinThread(); } }
@Test public void testCreate() { WebApp app = WebApps.$for(this).start(); app.stop(); }
@Test public void testCreate() { WebApp app = WebApps.$for(this).start(); app.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(); }
@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(); }