当前位置: 首页>>代码示例>>Java>>正文


Java WebAppUtils.getAHSWebAppURLWithoutScheme方法代码示例

本文整理汇总了Java中org.apache.hadoop.yarn.webapp.util.WebAppUtils.getAHSWebAppURLWithoutScheme方法的典型用法代码示例。如果您正苦于以下问题:Java WebAppUtils.getAHSWebAppURLWithoutScheme方法的具体用法?Java WebAppUtils.getAHSWebAppURLWithoutScheme怎么用?Java WebAppUtils.getAHSWebAppURLWithoutScheme使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.yarn.webapp.util.WebAppUtils的用法示例。


在下文中一共展示了WebAppUtils.getAHSWebAppURLWithoutScheme方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAMContainerInfoForAHSWebService

import org.apache.hadoop.yarn.webapp.util.WebAppUtils; //导入方法依赖的package包/类
private List<JSONObject> getAMContainerInfoForAHSWebService(Configuration conf,
    String appId) throws ClientHandlerException, UniformInterfaceException,
    JSONException {
  Client webServiceClient = Client.create();
  String webAppAddress =
      WebAppUtils.getHttpSchemePrefix(conf)
          + WebAppUtils.getAHSWebAppURLWithoutScheme(conf);
  WebResource webResource = webServiceClient.resource(webAppAddress);

  ClientResponse response =
      webResource.path("ws").path("v1").path("applicationhistory").path("apps")
        .path(appId).path("appattempts").accept(MediaType.APPLICATION_JSON)
        .get(ClientResponse.class);
  JSONObject json = response.getEntity(JSONObject.class);
  JSONArray requests = json.getJSONArray("appAttempt");
  List<JSONObject> amContainersList = new ArrayList<JSONObject>();
  for (int i = 0; i < requests.length(); i++) {
    amContainersList.add(requests.getJSONObject(i));
  }
  Collections.reverse(amContainersList);
  return amContainersList;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:23,代码来源:LogsCLI.java

示例2: startWebApp

import org.apache.hadoop.yarn.webapp.util.WebAppUtils; //导入方法依赖的package包/类
protected void startWebApp() {
  String bindAddress = WebAppUtils.getAHSWebAppURLWithoutScheme(getConfig());
  LOG.info("Instantiating AHSWebApp at " + bindAddress);
  try {
    webApp =
        WebApps
          .$for("applicationhistory", ApplicationHistoryClientService.class,
            ahsClientService, "ws")
          .with(getConfig())
          .withHttpSpnegoPrincipalKey(
            YarnConfiguration.TIMELINE_SERVICE_WEBAPP_SPNEGO_USER_NAME_KEY)
          .withHttpSpnegoKeytabKey(
            YarnConfiguration.TIMELINE_SERVICE_WEBAPP_SPNEGO_KEYTAB_FILE_KEY)
          .at(bindAddress)
          .start(new AHSWebApp(historyManager, timelineStore));
  } catch (Exception e) {
    String msg = "AHSWebApp failed to start.";
    LOG.error(msg, e);
    throw new YarnRuntimeException(msg, e);
  }
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:22,代码来源:ApplicationHistoryServer.java

示例3: setup

import org.apache.hadoop.yarn.webapp.util.WebAppUtils; //导入方法依赖的package包/类
@Before
public void setup() {
  historyServer = new ApplicationHistoryServer();
  Configuration config = new YarnConfiguration();
  expectedLogUrl = WebAppUtils.getHttpSchemePrefix(config) +
      WebAppUtils.getAHSWebAppURLWithoutScheme(config) +
      "/applicationhistory/logs/localhost:0/container_0_0001_01_000001/" +
      "container_0_0001_01_000001/test user";
  config.setClass(YarnConfiguration.APPLICATION_HISTORY_STORE,
    MemoryApplicationHistoryStore.class, ApplicationHistoryStore.class);
  historyServer.init(config);
  historyServer.start();
  store =
      ((ApplicationHistoryManagerImpl) historyServer.getApplicationHistory())
        .getHistoryStore();
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:17,代码来源:TestApplicationHistoryClientService.java

示例4: serviceInit

import org.apache.hadoop.yarn.webapp.util.WebAppUtils; //导入方法依赖的package包/类
@Override
protected void serviceInit(Configuration conf) throws Exception {
  LOG.info("ApplicationHistory Init");
  historyStore = createApplicationHistoryStore(conf);
  historyStore.init(conf);
  serverHttpAddress = WebAppUtils.getHttpSchemePrefix(conf) +
      WebAppUtils.getAHSWebAppURLWithoutScheme(conf);
  super.serviceInit(conf);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:ApplicationHistoryManagerImpl.java

示例5: serviceInit

import org.apache.hadoop.yarn.webapp.util.WebAppUtils; //导入方法依赖的package包/类
@Override
protected void serviceInit(Configuration conf) throws Exception {
  serverHttpAddress = WebAppUtils.getHttpSchemePrefix(conf) +
      WebAppUtils.getAHSWebAppURLWithoutScheme(conf);
  maxLoadedApplications =
      conf.getLong(YarnConfiguration.APPLICATION_HISTORY_MAX_APPS,
        YarnConfiguration.DEFAULT_APPLICATION_HISTORY_MAX_APPS);
  super.serviceInit(conf);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:10,代码来源:ApplicationHistoryManagerOnTimelineStore.java

示例6: serviceInit

import org.apache.hadoop.yarn.webapp.util.WebAppUtils; //导入方法依赖的package包/类
@Override
protected void serviceInit(Configuration conf) throws Exception {
  serverHttpAddress = WebAppUtils.getHttpSchemePrefix(conf) +
      WebAppUtils.getAHSWebAppURLWithoutScheme(conf);
  super.serviceInit(conf);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:7,代码来源:ApplicationHistoryManagerOnTimelineStore.java


注:本文中的org.apache.hadoop.yarn.webapp.util.WebAppUtils.getAHSWebAppURLWithoutScheme方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。