Examples of stopAndWait()


Examples of org.apache.twill.api.TwillController.stopAndWait()

      Assert.assertEquals(msg, reader.readLine());
    } finally {
      socket.close();
    }

    controller.stopAndWait();

    Assert.assertTrue(YarnTestUtils.waitForSize(discoverables, 0, 60));

    TimeUnit.SECONDS.sleep(2);
  }
View Full Code Here

Examples of org.apache.twill.api.TwillController.stopAndWait()

      if (iterator.hasNext()) {
        LOG.warn("Found more than one instance of {} running. Stopping the others...", serviceName);
        for (; iterator.hasNext(); ) {
          TwillController controller = iterator.next();
          LOG.warn("Stopping one extra instance of {}", serviceName);
          controller.stopAndWait();
        }
        LOG.warn("Done stopping extra instances of {}", serviceName);
      }
    } else {
      LOG.info("Starting {} application", serviceName);
View Full Code Here

Examples of org.apache.twill.api.TwillController.stopAndWait()

    Assert.assertTrue(YarnTestUtils.waitForSize(discoverables, 2, 60));

    // Make sure we see the right instance IDs
    Assert.assertEquals(Sets.newHashSet(0, 1), getInstances(discoverables));

    controller.stopAndWait();
  }

  private Set<Integer> getInstances(Iterable<Discoverable> discoverables) throws IOException {
    Set<Integer> instances = Sets.newHashSet();
    for (Discoverable discoverable : discoverables) {
View Full Code Here

Examples of org.apache.twill.api.TwillController.stopAndWait()

      } catch (TimeoutException e) {
        // OK, expected.
      }
    }

    controller.stopAndWait();
  }

  private boolean expireAppMasterZKSession(TwillController controller, long timeout, TimeUnit timeoutUnit) {
    MBeanServer mbeanServer = MBeanRegistry.getInstance().getPlatformMBeanServer();
    QueryExp query = Query.isInstanceOf(new StringValueExp(ConnectionMXBean.class.getName()));
View Full Code Here

Examples of org.apache.twill.api.TwillController.stopAndWait()

    ListenableFuture<Service.State> completion = Services.getCompletionFuture(controller);
    try {
      completion.get(60, TimeUnit.SECONDS);
    } finally {
      controller.stopAndWait();
    }
  }

  /**
   * An application that contains two {@link ServiceRunnable}.
View Full Code Here

Examples of org.apache.twill.api.TwillController.stopAndWait()

      Assert.assertEquals(msg, reader.readLine());
    } finally {
      socket.close();
    }

    controller.stopAndWait();

    Assert.assertTrue(YarnTestUtils.waitForSize(discoverables, 0, 60));

    TimeUnit.SECONDS.sleep(2);
  }
View Full Code Here

Examples of org.apache.twill.api.TwillController.stopAndWait()

        .start();

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

    try {
View Full Code Here

Examples of org.apache.twill.api.TwillRunnerService.stopAndWait()

        c.stop().get(30, TimeUnit.SECONDS);
      }

      Assert.assertTrue(YarnTestUtils.waitForSize(apps, 0, 60));
    } finally {
      runnerService.stopAndWait();
    }

    // Sleep a bit before exiting.
    TimeUnit.SECONDS.sleep(2);
  }
View Full Code Here

Examples of org.apache.twill.api.TwillRunnerService.stopAndWait()

        c.stop().get(30, TimeUnit.SECONDS);
      }

      Assert.assertTrue(YarnTestUtils.waitForSize(apps, 0, 60));
    } finally {
      runnerService.stopAndWait();
    }

    // Sleep a bit before exiting.
    TimeUnit.SECONDS.sleep(2);
  }
View Full Code Here

Examples of org.apache.twill.api.TwillRunnerService.stopAndWait()

    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.