Package org.apache.twill.api.logging

Examples of org.apache.twill.api.logging.PrinterLogHandler


  @Test
  public void testProvisionTimeout() throws InterruptedException, ExecutionException, TimeoutException {
    TwillRunner runner = YarnTestUtils.getTwillRunner();

    TwillController controller = runner.prepare(new TimeoutApplication())
                                       .addLogHandler(new PrinterLogHandler(new PrintWriter(System.out, true)))
                                       .start();

    // The provision should failed in 30 seconds after AM started, which AM could took a while to start.
    // Hence we give 90 seconds max time here.
    try {
View Full Code Here


    }

    TwillController controller = runner.prepare(new LocalFileApplication())
      .withApplicationArguments("local")
      .withArguments("LocalFileSocketServer", "local2")
      .addLogHandler(new PrinterLogHandler(new PrintWriter(System.out, true)))
      .start();

    if (runner instanceof YarnTwillRunnerService) {
      ((YarnTwillRunnerService) runner).setJVMOptions(prevJVMOptions);
    }
View Full Code Here


    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() {
View Full Code Here

        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() {
View Full Code Here

    return preparer;
  }

  private TwillPreparer getPreparer() {
    TwillPreparer preparer = twillRunnerService.prepare(twillApplication)
      .addLogHandler(new PrinterLogHandler(new PrintWriter(System.out)));

    // Add system logback file to the preparer
    URL logbackUrl = getClass().getResource("/logback.xml");
    if (logbackUrl == null) {
      LOG.warn("Cannot find logback.xml to pass onto Twill Runnables!");
View Full Code Here

          LOG.info("Starting {} with debugging enabled.", program.getId());
          twillPreparer.enableDebugging();
        }
        TwillController twillController = twillPreparer
          .withDependencies(new HBaseTableUtilFactory().get().getClass())
          .addLogHandler(new PrinterLogHandler(new PrintWriter(System.out)))
          .addSecureStore(YarnSecureStore.create(HBaseTokenUtils.obtainToken(hConf, new Credentials())))
          .withApplicationArguments(
            String.format("--%s", RunnableOptions.JAR), copiedProgram.getJarLocation().getName(),
            String.format("--%s", RunnableOptions.RUNTIME_ARGS), runtimeArgs
          ).start();
View Full Code Here

TOP

Related Classes of org.apache.twill.api.logging.PrinterLogHandler

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.