Examples of YarnTwillRunnerService


Examples of org.apache.twill.yarn.YarnTwillRunnerService

                          configuration.get(Constants.CFG_TWILL_ZK_NAMESPACE);

    // Copy the yarn config and set the max heap ratio.
    YarnConfiguration yarnConfig = new YarnConfiguration(yarnConfiguration);
    yarnConfig.set(Constants.CFG_TWILL_RESERVED_MEMORY_MB, configuration.get(Constants.CFG_TWILL_RESERVED_MEMORY_MB));
    YarnTwillRunnerService runner = new YarnTwillRunnerService(yarnConfig,
                                                               zkConnectStr,
                                                               LocationFactories.namespace(locationFactory, "twill"));

    // Set JVM options based on configuration
    runner.setJVMOptions(configuration.get(Constants.AppFabric.PROGRAM_JVM_OPTS));

    return runner;
  }
View Full Code Here

Examples of org.apache.twill.yarn.YarnTwillRunnerService

                          configuration.get(Constants.CFG_TWILL_ZK_NAMESPACE);

    // Copy the yarn config and set the max heap ratio.
    YarnConfiguration yarnConfig = new YarnConfiguration(yarnConfiguration);
    yarnConfig.set(Constants.CFG_TWILL_RESERVED_MEMORY_MB, configuration.get(Constants.CFG_TWILL_RESERVED_MEMORY_MB));
    YarnTwillRunnerService runner = new YarnTwillRunnerService(yarnConfig,
                                                               zkConnectStr,
                                                               LocationFactories.namespace(locationFactory, "twill"));

    // Set JVM options based on configuration
    runner.setJVMOptions(configuration.get(Constants.Container.PROGRAM_JVM_OPTS));

    return runner;
  }
View Full Code Here

Examples of org.apache.twill.yarn.YarnTwillRunnerService

    File jarFile = new File(arguments.getJarFileName());
    Preconditions.checkArgument(jarFile != null);
    Preconditions.checkState(jarFile.exists());
    Preconditions.checkState(jarFile.canRead());

    final TwillRunnerService twillRunner = new YarnTwillRunnerService(new YarnConfiguration(), zkStr);
    twillRunner.startAndWait();


    final TwillController controller = twillRunner.prepare(
      new ExampleBundledJarApp(jarFile.getName(), jarFile.toURI()))
      .withArguments("BundledJarRunnable", arguments.toArray())
      .addLogHandler(new PrinterLogHandler(new PrintWriter(System.out, true)))
      .start();

    Runtime.getRuntime().addShutdownHook(new Thread() {
      @Override
      public void run() {
        controller.stopAndWait();
        twillRunner.stopAndWait();
      }
    });

    try {
      Services.getCompletionFuture(controller).get();
View Full Code Here

Examples of org.apache.twill.yarn.YarnTwillRunnerService

    }

    String zkStr = args[0];

    final TwillRunnerService twillRunner =
      new YarnTwillRunnerService(
        new YarnConfiguration(), zkStr);
    twillRunner.startAndWait();

    final TwillController controller =
      twillRunner.prepare(new HelloWorldRunnable())
        .addLogHandler(new PrinterLogHandler(new PrintWriter(System.out, true)))
        .start();

    Runtime.getRuntime().addShutdownHook(new Thread() {
      @Override
      public void run() {
        controller.stopAndWait();
        twillRunner.stopAndWait();
      }
    });

    try {
      Services.getCompletionFuture(controller).get();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.