gpt4 book ai didi

org.springframework.yarn.client.YarnClient.getApplicationReport()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 04:59:31 27 4
gpt4 key购买 nike

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

YarnClient.getApplicationReport介绍

[英]Gets a report of the application.
[中]获取应用程序的报告。

代码示例

代码示例来源:origin: org.springframework.data/spring-yarn-boot

private YarnContainerClusterOperations buildClusterOperations(RestTemplate restTemplate, YarnClient client, ApplicationId applicationId) {
  ApplicationReport report = client.getApplicationReport(applicationId);
  String trackingUrl = report.getOriginalTrackingUrl();
  return new YarnContainerClusterTemplate(trackingUrl + "/" + YarnContainerClusterEndpoint.ENDPOINT_ID, restTemplate);
}

代码示例来源:origin: org.springframework.data/spring-yarn-boot

@Override
public String runWithSpringApplication(ApplicationContext context) throws Exception {
  OperationProperties operationProperties = context.getBean(OperationProperties.class);
  ApplicationId applicationId = ConverterUtils.toApplicationId(operationProperties.getApplicationId());
  YarnClient client = context.getBean(YarnClient.class);
  ApplicationReport report = client.getApplicationReport(applicationId);
  String trackingUrl = report.getOriginalTrackingUrl();
  RestTemplate restTemplate = context.getBean(YarnSystemConstants.DEFAULT_ID_RESTTEMPLATE, RestTemplate.class);
  restTemplate.postForObject(trackingUrl + "/shutdown", null, Void.class);
  return "shutdown requested";
}

代码示例来源:origin: org.springframework.cloud/spring-cloud-deployer-yarn

private synchronized YarnContainerClusterOperations buildClusterOperations(RestTemplate restTemplate,
    YarnClient client, ApplicationId applicationId) {
  String key = applicationId.toString();
  YarnContainerClusterOperations operations = operationsCache.get(key);
  if (operations == null) {
    ApplicationReport report = client.getApplicationReport(applicationId);
    String trackingUrl = report.getOriginalTrackingUrl();
    operations = new YarnContainerClusterTemplate(trackingUrl + "/" + YarnContainerClusterEndpoint.ENDPOINT_ID,
        restTemplate);
    operationsCache.put(key, operations);
  }
  return operations;
}

代码示例来源:origin: org.springframework.data/spring-yarn-boot

@Override
public String runWithSpringApplication(ApplicationContext context) throws Exception {
  YarnClient client = context.getBean(YarnClient.class);
  OperationProperties operationProperties = context.getBean(OperationProperties.class);
  ApplicationId applicationId = ConverterUtils.toApplicationId(operationProperties.getApplicationId());
  ApplicationReport report = client.getApplicationReport(applicationId);
  if (report.getYarnApplicationState() == YarnApplicationState.FINISHED
      || report.getYarnApplicationState() == YarnApplicationState.KILLED
      || report.getYarnApplicationState() == YarnApplicationState.FAILED) {
    return "Application " + applicationId + " is not running";
  } else {
    client.killApplication(applicationId);
    return "Kill request for " + applicationId + " sent";
  }
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com