gpt4 book ai didi

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

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

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

YarnClient.killApplication介绍

[英]Requests a resource manager to kill the application.
[中]请求资源管理器终止应用程序。

代码示例

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

/**
 * Kill the application.
 *
 * @param applicationId the application id
 */
protected void killApplication(ApplicationId applicationId) {
  Assert.notNull(getYarnClient(), "Yarn client must be set");
  Assert.notNull(applicationId, "ApplicationId must not be null");
  getYarnClient().killApplication(applicationId);
}

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

@Override
protected ExitStatus handleBeanRun(YarnClient bean, String[] parameters, Set<String> opts) {
  Properties properties = StringUtils.splitArrayElementsIntoProperties(parameters, "=");
  if (opts.contains(OPT_SUBMIT)) {
    bean.submitApplication();
  } else if (opts.contains(OPT_LIST)) {
    printApplicationsReport(bean.listApplications());
  } else if (opts.contains(OPT_KILL)) {
    ApplicationId appId = queryApplicationId(bean,
        properties != null ? properties.getProperty(ARG_APPLICATION_ID) : null);
    if (appId != null) {
      bean.killApplication(appId);
    }
  }
  return ExitStatus.COMPLETED;
}

代码示例来源: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";
  }
}

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