Examples of startAndWait()


Examples of co.cask.http.NettyHttpService.startAndWait()

      NettyHttpService.Builder builder = NettyHttpService.builder();
      builder.addHttpHandlers(ImmutableSet.of(jarHttpHandler));
      builder.setUrlRewriter(new WebappURLRewriter(jarHttpHandler));
      builder.setHost(hostname.getCanonicalHostName());
      NettyHttpService httpService = builder.build();
      httpService.startAndWait();
      final InetSocketAddress address = httpService.getBindAddress();

      RunId runId = RunIds.generate();

      // Register service, and the serving host names.
View Full Code Here

Examples of co.cask.tephra.TransactionManager.startAndWait()

    TransactionStateStorage storage3 = null;
    try {
      storage = getStorage(conf);
      TransactionManager txManager = new TransactionManager
        (conf, storage, new TxMetricsCollector());
      txManager.startAndWait();

      // TODO: replace with new persistence tests
      final byte[] a = { 'a' };
      final byte[] b = { 'b' };
      // start a tx1, add a change A and commit
View Full Code Here

Examples of co.cask.tephra.coprocessor.TransactionStateCache.startAndWait()

  @Test
  public void testTransactionStateCache() throws Exception {
    TransactionStateCache cache = new TransactionStateCache();
    cache.setConf(conf);
    cache.startAndWait();
    // verify that the transaction snapshot read matches what we wrote in setupBeforeClass()
    TransactionSnapshot cachedSnapshot = cache.getLatestState();
    assertNotNull(cachedSnapshot);
    assertEquals(invalidSet, cachedSnapshot.getInvalid());
    cache.stopAndWait();
View Full Code Here

Examples of co.cask.tephra.persist.HDFSTransactionStateStorage.startAndWait()

        // this will set visibility upper bound to V[6]
        Maps.newTreeMap(ImmutableSortedMap.of(V[6], new TransactionManager.InProgressTx(V[6] - 1, Long.MAX_VALUE))),
        new HashMap<Long, Set<ChangeId>>(), new TreeMap<Long, Set<ChangeId>>());
    HDFSTransactionStateStorage tmpStorage =
      new HDFSTransactionStateStorage(conf, new SnapshotCodecProvider(conf));
    tmpStorage.startAndWait();
    tmpStorage.writeSnapshot(snapshot);
    tmpStorage.stopAndWait();
  }

  @AfterClass
View Full Code Here

Examples of co.cask.tigon.sql.manager.ExternalProgramExecutor.startAndWait()

    Location rootTmpDir = Locations.getParent(Locations.getParent(dir));
    Location shell = new LocalLocationFactory(new File("/")).create("/").append("bin").append("sh");

    ExternalProgramExecutor copyGSEXIT = new ExternalProgramExecutor("Copy GSEXIT", dir, shell, "-c",
                                                                     "cp ../../bin/gsexit ./GSEXIT");
    copyGSEXIT.startAndWait();
    LOG.info("Copying GSEXIT: {}", copyGSEXIT);
    Services.getCompletionFuture(copyGSEXIT).get(20, TimeUnit.SECONDS);
    if (copyGSEXIT.getExitCode() != 0) {
      throw new RuntimeException("Stream Engine Binary Failed - GSEXIT copy failed");
    }
View Full Code Here

Examples of co.cask.tigon.sql.manager.ExternalProgramExecutor.startAndWait()

    }
    ExternalProgramExecutor executorService = new ExternalProgramExecutor(
      "GENBINS", dir, shell, "-c",
      "../../bin/translate_fta -h localhost -c -S -M -C . packet_schema.txt " + Constants.GSQL_FILE);
    LOG.info("Starting GENBINS : {}", executorService);
    executorService.startAndWait();
    Services.getCompletionFuture(executorService).get(20, TimeUnit.SECONDS);
    if (executorService.getExitCode() != 0) {
      throw new RuntimeException("Stream Engine Binary BUILD Failed");
    }
    ExternalProgramExecutor makeService = new ExternalProgramExecutor(
View Full Code Here

Examples of co.cask.tigon.sql.manager.ExternalProgramExecutor.startAndWait()

      throw new RuntimeException("Stream Engine Binary BUILD Failed");
    }
    ExternalProgramExecutor makeService = new ExternalProgramExecutor(
      "GENBINS", dir, shell, "-c", "make");
    LOG.info("Starting MAKE : {}", executorService);
    makeService.startAndWait();
    Services.getCompletionFuture(makeService).get(20, TimeUnit.SECONDS);
    if (makeService.getExitCode() != 0) {
      throw new RuntimeException("Stream Engine Binary MAKE Failed");
    }
  }
View Full Code Here

Examples of com.cloudera.kitten.appmaster.service.ApplicationMasterServiceImpl.startAndWait()

  @Override
  public int run(String[] args) throws Exception {
    ApplicationMasterParameters params = new LuaApplicationMasterParameters(getConf());
    ApplicationMasterService service = new ApplicationMasterServiceImpl(params, getConf());
    service.startAndWait();
    while (service.hasRunningContainers()) {
      Thread.sleep(1000);
    }
    service.stopAndWait();
    return 0;
View Full Code Here

Examples of com.google.common.util.concurrent.Service.startAndWait()

      RunId runId = RunIds.generate();
      ZKClientService zkClientService = ZKClientService.Builder.of(zkServer.getConnectionStr()).build();
      zkClientService.startAndWait();

      Service service = createService(zkClientService, runId);
      service.startAndWait();

      TwillController controller = getController(zkClientService, runId);
      controller.sendCommand(Command.Builder.of("test").build()).get(2, TimeUnit.SECONDS);
      controller.stop().get(2, TimeUnit.SECONDS);
View Full Code Here

Examples of com.google.common.util.concurrent.Service.startAndWait()

      RunId runId = RunIds.generate();
      ZKClientService zkClientService = ZKClientService.Builder.of(zkServer.getConnectionStr()).build();
      zkClientService.startAndWait();

      Service service = createService(zkClientService, runId);
      service.startAndWait();

      final CountDownLatch runLatch = new CountDownLatch(1);
      TwillController controller = getController(zkClientService, runId);
      controller.addListener(new ServiceListenerAdapter() {
        @Override
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.