/** * Returns the job status for the given job id. The job status includes things like where it's * deployed, and the status of the jobs where it's deployed, etc. * * @param id The job ID. * * @return The job status. */ @Path("{id}/status") @GET @Produces(APPLICATION_JSON) @Timed @ExceptionMetered public Optional<JobStatus> statusGet(@PathParam("id") @Valid final JobId id) { if (!id.isFullyQualified()) { throw badRequest("Invalid id"); } return Optional.fromNullable(model.getJobStatus(id)); }
@Path("/statuses") @POST @Produces(APPLICATION_JSON) @Timed @ExceptionMetered public Map<JobId, JobStatus> jobStatuses(@Valid final Set<JobId> ids) { for (final JobId id : ids) { if (!id.isFullyQualified()) { 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; } }
final JobStatus status = masterModel.getJobStatus(jobId); final List<String> hosts = ImmutableList.copyOf(status.getDeployments().keySet());
final JobStatus jobStatus = masterModel.getJobStatus(jobId); final Map<String, Deployment> deployments = jobStatus.getDeployments(); final List<TaskStatusEvent> events = masterModel.getJobHistory(jobId);
/** * Returns the job status for the given job id. The job status includes things like where it's * deployed, and the status of the jobs where it's deployed, etc. * * @param id The job ID. * @return The job status. */ @Path("{id}/status") @GET @Produces(APPLICATION_JSON) @Timed @ExceptionMetered public Optional<JobStatus> statusGet(@PathParam("id") @Valid final JobId id) { if (!id.isFullyQualified()) { throw badRequest("Invalid id"); } return Optional.fromNullable(model.getJobStatus(id)); }
@Path("/statuses") @POST @Produces(APPLICATION_JSON) @Timed @ExceptionMetered public Map<JobId, JobStatus> jobStatuses(@Valid final Set<JobId> ids) { for (final JobId id : ids) { if (!id.isFullyQualified()) { 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; } }
continue; } else if (job.getExpires().getTime() <= clock.now().getMillis()) { final JobStatus status = masterModel.getJobStatus(jobId); final List<String> hosts = ImmutableList.copyOf(status.getDeployments().keySet());