Examples of stopAsync()


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

    Service cronLifecycle = boot();

    assertTrue(cronLifecycle.isRunning());
    assertTrue(scheduler.isStarted());

    cronLifecycle.stopAsync().awaitTerminated();

    assertTrue(!cronLifecycle.isRunning());
    assertTrue(scheduler.isShutdown());
  }
View Full Code Here

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

    scheduler.getListenerManager().addTriggerListener(new CountDownWhenComplete(cronRan));
    Service service = boot();

    cronRan.await();

    service.stopAsync().awaitTerminated();
  }

  @Test
  public void testKillExistingDogpiles() throws Exception {
    // Test that a trigger for a job that hasn't finished running is ignored.
View Full Code Here

Examples of com.google.common.util.concurrent.ServiceManager.stopAsync()

                LOG.info(msg);
                finalActivityWriter.write(new Activity(msg, Main.class));

                GracefulShutdown shutdown = injector.getInstance(GracefulShutdown.class);
                shutdown.runWithoutExit();
                finalServiceManager.stopAsync().awaitStopped();
            }
        });

        // Register this node.
        final NodeService nodeService = injector.getInstance(NodeService.class);
View Full Code Here

Examples of com.google.common.util.concurrent.ServiceManager.stopAsync()

      serviceManager.startAsync().awaitHealthy();
      try {
        CaliperRun run = injector.getInstance(CaliperRun.class); // throws wrapped ICE, IBE
        run.run(); // throws IBE
      } finally {
        serviceManager.stopAsync();
      }
    } catch (CreationException e) {
      propogateIfCaliperException(e.getCause());
      throw e;
    } catch (ProvisionException e) {
View Full Code Here

Examples of com.spotify.helios.agent.AgentMain.stopAsync()

        }
      });
      assertEquals(expectedMapping1, restartedTaskStatus1.getPorts());

      // Verify that port allocation is kept across agent restarts
      agent1.stopAsync().awaitTerminated();
      dockerClient.killContainer(firstTaskStatus2.getContainerId());
      startDefaultAgent(testHost());
      final TaskStatus restartedTaskStatus2 = Polling.await(
          LONG_WAIT_SECONDS, SECONDS, new Callable<TaskStatus>() {
        @Override
View Full Code Here

Examples of com.spotify.helios.agent.AgentMain.stopAsync()

    // Wait for the job to run
    awaitJobState(client, host, jobId, RUNNING, LONG_WAIT_SECONDS, SECONDS);

    // Kill off agent
    agent.stopAsync().awaitTerminated();

    // Deregister agent
    final HostDeregisterResponse deregisterResponse = client.deregisterHost(host).get();
    assertEquals(HostDeregisterResponse.Status.OK, deregisterResponse.getStatus());
View Full Code Here

Examples of com.spotify.helios.agent.AgentMain.stopAsync()

  public void verifyAgentPushesTaskStateAfterRestore() throws Exception {

    // Start agent once to have it register
    final AgentMain agent1 = startDefaultAgent(testHost());
    awaitHostStatus(client, testHost(), UP, LONG_WAIT_SECONDS, SECONDS);
    agent1.stopAsync().awaitTerminated();

    // Deploy job
    final Deployment deployment = Deployment.of(fooJob.getId(), START);
    final JobDeployResponse deployed = client.deploy(deployment, testHost()).get();
    assertEquals(JobDeployResponse.Status.OK, deployed.getStatus());
View Full Code Here

Examples of com.spotify.helios.agent.AgentMain.stopAsync()

    assertEquals(job, firstTaskStatus.getJob());
    assertEquals(1, listContainers(dockerClient, testTag).size());
    assertTrue(dockerClient.inspectContainer(firstTaskStatus.getContainerId()).state().running());

    // Stop the agent
    agent1.stopAsync().awaitTerminated();
    awaitHostStatus(client, testHost(), DOWN, LONG_WAIT_SECONDS, SECONDS);

    // Start the agent again
    final AgentMain agent2 = startDefaultAgent(testHost());
    awaitHostStatus(client, testHost(), UP, LONG_WAIT_SECONDS, SECONDS);
View Full Code Here

Examples of com.spotify.helios.agent.AgentMain.stopAsync()

    assertEquals(firstTaskStatus.getContainerId(), taskStatus.getContainerId());
    assertEquals(1, listContainers(dockerClient, testTag).size());
    assertTrue(dockerClient.inspectContainer(firstTaskStatus.getContainerId()).state().running());

    // Stop the agent
    agent2.stopAsync().awaitTerminated();
    awaitHostStatus(client, testHost(), DOWN, LONG_WAIT_SECONDS, SECONDS);

    // Kill the container
    dockerClient.killContainer(firstTaskStatus.getContainerId());
    assertEquals(0, listContainers(dockerClient, testTag).size());
View Full Code Here

Examples of com.spotify.helios.agent.AgentMain.stopAsync()

        });
    assertEquals(1, listContainers(dockerClient, testTag).size());
    assertTrue(dockerClient.inspectContainer(secondTaskStatus.getContainerId()).state().running());

    // Stop the agent
    agent3.stopAsync().awaitTerminated();
    awaitHostStatus(client, testHost(), DOWN, LONG_WAIT_SECONDS, SECONDS);

    // Kill and destroy the container
    dockerClient.killContainer(secondTaskStatus.getContainerId());
    removeContainer(dockerClient, secondTaskStatus.getContainerId());
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.