Package org.springframework.yarn.launch

Examples of org.springframework.yarn.launch.LaunchCommandsFactoryBean


  /**
   * Builds a raw command set used to start application master.
   */
  private static String[] createMasterCommands(SpringYarnClientLaunchContextProperties syclcp) throws Exception {
    LaunchCommandsFactoryBean factory = new LaunchCommandsFactoryBean();
    String appmasterJar = syclcp.getArchiveFile();

    if (StringUtils.hasText(appmasterJar) && appmasterJar.endsWith("jar")) {
      factory.setJarFile(syclcp.getArchiveFile());
    } else if (StringUtils.hasText(syclcp.getRunnerClass())) {
      factory.setRunnerClass(syclcp.getRunnerClass());
    } else if (StringUtils.hasText(appmasterJar) && appmasterJar.endsWith("zip")) {
      factory.setRunnerClass("org.springframework.boot.loader.PropertiesLauncher");
    }

    factory.setArgumentsList(syclcp.getArgumentsList());

    if (syclcp.getArguments() != null) {
      Properties arguments = new Properties();
      arguments.putAll(syclcp.getArguments());
      factory.setArguments(arguments);
    }

    factory.setOptions(syclcp.getOptions());

    factory.setStdout("<LOG_DIR>/Appmaster.stdout");
    factory.setStderr("<LOG_DIR>/Appmaster.stderr");
    factory.afterPropertiesSet();
    return factory.getObject();
  }
View Full Code Here


  /** Command line arguments */
  private Properties arguments;

  @Override
  public void configure(YarnClientBuilder builder) throws Exception {
    LaunchCommandsFactoryBean fb = new LaunchCommandsFactoryBean();
    fb.setRunner(CommandLineAppmasterRunner.class);
    fb.setContextFile(determineContextConfig());
    fb.setBeanName(beanName);
    fb.setStdout(stdout);
    fb.setStderr(stderr);
    fb.setArguments(arguments);
    fb.afterPropertiesSet();
    builder.setCommands(fb.getObject());
  }
View Full Code Here

  private Properties arguments = new Properties();

  @Override
  public void configure(YarnAppmasterBuilder builder) throws Exception {
    LaunchCommandsFactoryBean fb = new LaunchCommandsFactoryBean();
    fb.setRunner(runnerClass);
    fb.setContextFile(contextClass != null ?  contextClass.getCanonicalName() : contextFile);
    fb.setBeanName(beanName);

    fb.setArguments(arguments);

    fb.setStdout(stdout);
    fb.setStderr(stderr);
    fb.afterPropertiesSet();
    builder.containerCommands(fb.getObject());
  }
View Full Code Here

  private static String explodedEntryIfZip(SpringYarnAppmasterLaunchContextProperties syalcp) {
    return StringUtils.endsWithIgnoreCase(syalcp.getArchiveFile(), ".zip") ? "./" + syalcp.getArchiveFile() : null;
  }

  private static String[] createContainerCommands(SpringYarnAppmasterLaunchContextProperties syalcp) throws Exception {
    LaunchCommandsFactoryBean factory = new LaunchCommandsFactoryBean();
    String containerJar = syalcp.getArchiveFile();

    if (StringUtils.hasText(containerJar) && containerJar.endsWith("jar")) {
      factory.setJarFile(containerJar);
    } else if (StringUtils.hasText(syalcp.getRunnerClass())) {
      factory.setRunnerClass(syalcp.getRunnerClass());
    } else if (StringUtils.hasText(containerJar) && containerJar.endsWith("zip")) {
      factory.setRunnerClass("org.springframework.boot.loader.PropertiesLauncher");
    }

    factory.setArgumentsList(syalcp.getArgumentsList());

    if (syalcp.getArguments() != null) {
      Properties arguments = new Properties();
      arguments.putAll(syalcp.getArguments());
      factory.setArguments(arguments);
    }

    factory.setOptions(syalcp.getOptions());

    factory.setStdout("<LOG_DIR>/Container.stdout");
    factory.setStderr("<LOG_DIR>/Container.stderr");
    factory.afterPropertiesSet();
    return factory.getObject();
  }
View Full Code Here

TOP

Related Classes of org.springframework.yarn.launch.LaunchCommandsFactoryBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.