org.springframework.yarn.am.YarnAppmaster类的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(102)

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

YarnAppmaster介绍

[英]Interface defining main application master methods needed for external launch implementations.
[中]定义外部启动实现所需的主要应用程序主方法的接口。

代码示例

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

@Override
protected ExitStatus handleBeanRun(YarnAppmaster bean, String[] parameters, Set<String> opts) {
  Properties properties = StringUtils.splitArrayElementsIntoProperties(parameters, "=");
  bean.setParameters(properties != null ? properties : new Properties());
  bean.setEnvironment(System.getenv());
  if(log.isDebugEnabled()) {
    log.debug("Starting YarnAppmaster bean: " + StringUtils.arrayToCommaDelimitedString(parameters));
  }
  bean.addAppmasterStateListener(new AppmasterStateListener() {
    @Override
    public void state(AppmasterState state) {
      if(state == AppmasterState.COMPLETED) {
        latch.countDown();
      }
    }
  });
  bean.submitApplication();
  if(log.isDebugEnabled()) {
    log.debug("Waiting latch to receive appmaster complete state");
  }
  try {
    latch.await();
  } catch (InterruptedException e) {
    log.debug("Latch interrupted");
  }
  log.info("Bean run completed");
  return ExitStatus.COMPLETED;
}

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

properties.put(AppmasterConstants.CONTAINER_COUNT, Integer.toString(containerCount));
appmaster.setParameters(properties);
appmaster.setEnvironment(System.getenv());
appmaster.addAppmasterStateListener(new AppmasterStateListener() {
  @Override
  public void state(AppmasterState state) {
appmaster.submitApplication();

相关文章