org.apache.hadoop.yarn.webapp.WebApp类的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中org.apache.hadoop.yarn.webapp.WebApp类的一些代码示例,展示了WebApp类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebApp类的具体详情如下:
包路径:org.apache.hadoop.yarn.webapp.WebApp
类名称:WebApp

WebApp介绍

暂无

代码示例

代码示例来源:origin: Qihoo360/XLearning

@Override
protected void serviceStop() throws Exception {
 if (server != null) {
  server.stop();
 }
 if (webApp != null) {
  webApp.stop();
 }
 super.serviceStop();
}

代码示例来源:origin: Qihoo360/XLearning

Method webAppBuild = WebApps.Builder.class.getMethod("build", WebApp.class);
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();
WebAppContext appWebAppContext = new WebAppContext();
try {
 httpServer.start();
 LOG.info("Web app " + webApp.name() + " started at "
   + httpServer.getConnectorAddress(0).getPort());
} catch (IOException e) {
 connectHost + ":" + webApp.getListenerAddress().getPort());

代码示例来源:origin: Qihoo360/XLearning

public int getHttpPort() {
  return webApp.port();
 }
}

代码示例来源:origin: Qihoo360/XLearning

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();
try {
 httpServer.start();
 LOG.info("Web app " + webApp.name() + " started at "
   + httpServer.getConnectorAddress(0).getPort());
} catch (IOException e) {

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common

@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();
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common

@Test public void testServePaths() {
 WebApp app = WebApps.$for("test", this).start();
 assertEquals("/test", app.getRedirectPath());
 String[] expectedPaths = { "/test", "/test/*" };
 String[] pathSpecs = app.getServePathSpecs();
   assertEquals(2, pathSpecs.length);
 for(int i = 0; i < expectedPaths.length; i++) {
  assertTrue(ArrayUtils.contains(pathSpecs, expectedPaths[i]));
 }
 app.stop();
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common

@Override public void run() {
  LOG.info("WebAppp /{} exiting...", webApp.name());
  webApp.stop();
  System.exit(0); // FINDBUG: this is intended in dev mode
 }
}, 18); // enough time for the last local request to complete

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-applicationhistoryservice

private InetSocketAddress getListenerAddress() {
 return this.webApp.httpServer().getConnectorAddress(0);
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common

public static void main(String[] args) {
  WebApps.$for(new HelloWorld()).at(8888).inDevMode().start().joinThread();
 }
}

代码示例来源:origin: io.hops/hadoop-yarn-server-nodemanager

@GET
@Path("/containers")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public ContainersInfo getNodeContainers(@javax.ws.rs.core.Context
  HttpServletRequest hsr) {
 init();
 ContainersInfo allContainers = new ContainersInfo();
 for (Entry<ContainerId, Container> entry : this.nmContext.getContainers()
   .entrySet()) {
  if (entry.getValue() == null) {
   // just skip it
   continue;
  }
  ContainerInfo info = new ContainerInfo(this.nmContext, entry.getValue(),
    uriInfo.getBaseUri().toString(), webapp.name(), hsr.getRemoteUser());
  allContainers.add(info);
 }
 return allContainers;
}

代码示例来源:origin: org.apache.tez/tez-dag

.with(conf)
  .start(this.tezAMWebApp);
InetSocketAddress address = webApp.getListenerAddress();
if (address != null) {
 InetSocketAddress bindAddress = NetUtils.createSocketAddrForHost(

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-common

String redirectPath = webApp.getRedirectPath();
 if (redirectPath != null && !redirectPath.isEmpty()) {
  res.sendRedirect(redirectPath);
rc.prefix = webApp.name();
Router.Dest dest = null;
try {

代码示例来源:origin: org.apache.apex/apex-engine

Configuration config = SecurityUtils.configureWebAppSecurity(getConfig(), dag.getValue(Context.DAGContext.SSL_CONFIG));
WebApp webApp = WebApps.$for("stram", StramAppContext.class, appContext, "ws").with(config).start(new StramWebApp(this.dnmgr));
LOG.info("Started web service at port: " + webApp.port());
connectAddress = NetUtils.getConnectAddress(webApp.getListenerAddress());
String hostname = connectAddress.getAddress().getCanonicalHostName();
if (hostname.equals(connectAddress.getAddress().getHostAddress())) {
appMasterTrackingUrl = hostname + ":" + webApp.port();
if (ConfigUtils.isSSLEnabled(config)) {
 appMasterTrackingUrl = "https://" + appMasterTrackingUrl;

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

@Override
public String getRedirectPath() {
 if (standby) {
  return buildRedirectPath();
 } else
  return super.getRedirectPath();
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-common

@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();
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common

@Test public void testServePathsNoName() {
 WebApp app = WebApps.$for("", this).start();
 assertEquals("/", app.getRedirectPath());
 String[] expectedPaths = { "/*" };
 String[] pathSpecs = app.getServePathSpecs();
   assertEquals(1, pathSpecs.length);
 for(int i = 0; i < expectedPaths.length; i++) {
  assertTrue(ArrayUtils.contains(pathSpecs, expectedPaths[i]));
 }
 app.stop();
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-common

@Override public void run() {
  LOG.info("WebAppp /{} exiting...", webApp.name());
  webApp.stop();
  System.exit(0); // FINDBUG: this is intended in dev mode
 }
}, 18); // enough time for the last local request to complete

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-applicationhistoryservice

private InetSocketAddress getListenerAddress() {
 return this.webApp.httpServer().getConnectorAddress(0);
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common

public static void main(String[] args) throws Exception {
  WebApps.$for(new MyApp()).at(8888).inDevMode().start().joinThread();
 }
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-nodemanager

@GET
@Path("/containers")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public ContainersInfo getNodeContainers() {
 init();
 ContainersInfo allContainers = new ContainersInfo();
 for (Entry<ContainerId, Container> entry : this.nmContext.getContainers()
   .entrySet()) {
  if (entry.getValue() == null) {
   // just skip it
   continue;
  }
  ContainerInfo info = new ContainerInfo(this.nmContext, entry.getValue(),
    uriInfo.getBaseUri().toString(), webapp.name());
  allContainers.add(info);
 }
 return allContainers;
}

相关文章