Package com.spotify.helios.common.descriptors

Examples of com.spotify.helios.common.descriptors.JobStatus


    final boolean all = options.getBoolean(allArg.getDest());
    final boolean force = options.getBoolean(forceArg.getDest());
    final List<String> hosts;

    if (all) {
      final JobStatus status = client.jobStatus(jobId).get();
      hosts = ImmutableList.copyOf(status.getDeployments().keySet());
      if (hosts.isEmpty()) {
        out.printf("%s is not currently deployed on any hosts.", jobId);
        return 0;
      }
View Full Code Here


      final TemporaryJob job = temporaryJobs.job()
          .command(IDLE_COMMAND)
          .hostFilter(testHost2)
          .deploy();

      final JobStatus status = client.jobStatus(job.job().getId()).get(15, SECONDS);
      final Map<String, Deployment> deployments = status.getDeployments();
      assertThat(deployments.keySet(), contains(testHost2));
    }
View Full Code Here

          .command(IDLE_COMMAND)
          .deploy();

      job.undeploy();

      final JobStatus status = client.jobStatus(job.job().getId()).get(15, SECONDS);
      assertNull("job still exists", status);
    }
View Full Code Here

        throw badRequest("Invalid id " + id);
      }
    }
    final Map<JobId, JobStatus> results = Maps.newHashMap();
    for (final JobId id : ids) {
      final JobStatus status = model.getJobStatus(id);
      if (status != null) {
        results.put(id, status);
      }
    }
    return results;
View Full Code Here

    // Wait for it to be running
    final Boolean ok = await(30, TimeUnit.SECONDS, new Callable<Boolean>() {
      @Override
      public Boolean call() throws Exception {
        final JobStatus result = client.jobStatus(id).get();
        final Set<Entry<String, TaskStatus>> statuses = result.getTaskStatuses().entrySet();
        if (statuses.isEmpty()) {
          return null;
        }

        final Entry<String, TaskStatus> last = Iterables.getLast(statuses);
View Full Code Here

    final TaskStatus status = Polling.awaitUnchecked(
        TIMEOUT_MILLIS, MILLISECONDS, new Callable<TaskStatus>() {
          @Override
          public TaskStatus call() throws Exception {
            final JobStatus status = Futures.getUnchecked(client.jobStatus(job.getId()));
            if (status == null) {
              log.debug("Job status not available");
              return null;
            }
            final TaskStatus taskStatus = status.getTaskStatuses().get(host);
            if (taskStatus == null) {
              log.debug("Task status not available on {}", host);
              return null;
            }
View Full Code Here

    }
  }

  void verifyHealthy() throws AssertionError {
    log.debug("Checking health of {}", job.getImage());
    final JobStatus status = Futures.getUnchecked(client.jobStatus(job.getId()));
    if (status == null) {
      return;
    }
    for (Map.Entry<String, TaskStatus> entry : status.getTaskStatuses().entrySet()) {
      verifyHealthy(entry.getKey(), entry.getValue());
    }
  }
View Full Code Here

          // Skip over job if the id doesn't start with current filename.
          if (!jobId.getName().startsWith(prefixFile.prefix())) {
            continue;
          }
          // Get list of all hosts where this job is deployed, and undeploy
          final JobStatus status = client.jobStatus(entry.getKey()).get();
          final List<String> hosts = ImmutableList.copyOf(status.getDeployments().keySet());
          final List<AssertionError> errors =
              undeploy(client, entry.getValue(), hosts, new ArrayList<AssertionError>());

          // Set flag indicating if any errors occur
          if (!errors.isEmpty()) {
View Full Code Here

      final Job job = entry.getValue();

      if (job.getExpires() == null) {
        continue;
      } else if (job.getExpires().getTime() <= clock.now().getMillis()) {
        final JobStatus status = masterModel.getJobStatus(jobId);
        final List<String> hosts = ImmutableList.copyOf(status.getDeployments().keySet());

        for (String host : hosts) {
          try {
            masterModel.undeployJob(host, jobId);
          } catch (HostNotFoundException e) {
View Full Code Here

      final Map<JobId, Job> jobs = client.jobs().get();

      // Verify job1 is still deployed and the prefix file has not been deleted.
      assertThat(jobs, hasKey(jobId1));
      final JobStatus status1 = client.jobStatus(jobId1).get();
      assertThat(status1.getDeployments().size(), is(1));
      assertTrue(fileExists(prefixDirectory, jobId1.getName()));

      // Verify job2 still exists, is not deployed, and the prefix file is still there.
      assertThat(jobs, hasKey(jobId2));
      final JobStatus status2 = client.jobStatus(jobId2).get();
      assertThat(status2.getDeployments().size(), is(0));
      assertTrue(fileExists(prefixDirectory, jobId2.getName()));

      // Verify that job3 has been deleted (which means it has also been undeployed), and
      // the prefix file has been deleted.
      assertThat(jobs, not(hasKey(jobId3)));
View Full Code Here

TOP

Related Classes of com.spotify.helios.common.descriptors.JobStatus

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.