public IJobStatus getJobStatus(IJob job) { return getJobStatus(job.getId()); } public IJobStatus getJobStatus(String jobId) {
private void toString(StringBuilder b, String jobId, int depth) { IJobStatus status = getJobStatus(jobId); b.append(StringUtils.repeat(' ', depth * TO_STRING_INDENT)); b.append(StringUtils.leftPad(new PercentFormatter().format( status.getProgress()), TO_STRING_INDENT)); b.append(" ").append(status.getJobId()); b.append(System.lineSeparator()); for (IJobStatus child : getChildren(jobId)) { toString(b, child.getJobId(), depth + 1); } } }
public IJobStatus getJobStatus(String jobId) { if (jobSuiteStatusSnapshot != null) { return jobSuiteStatusSnapshot.getJobStatus(jobId); } try { File indexFile = JEFUtil.getSuiteIndexFile(getWorkdir(), getId()); JobSuiteStatusSnapshot snapshot = JobSuiteStatusSnapshot.newSnapshot(indexFile); if (snapshot != null) { return snapshot.getJobStatus(jobId); } return null; } catch (IOException e) { throw new JEFException("Cannot obtain suite status.", e); } }
private void accept( IJobVisitor visitor, IJob job, Class<IJob> jobClassFilter) { if (job == null) { return; } if (jobClassFilter == null || jobClassFilter.isInstance(job)) { IJobStatus status = null; if (jobSuiteStatusSnapshot != null) { status = jobSuiteStatusSnapshot.getJobStatus(job); } visitor.visitJob(job, status); } if (job instanceof IJobGroup) { for (IJob childJob : ((IJobGroup) job).getJobs()) { accept(visitor, childJob, jobClassFilter); } } }
private void accept(IJobStatusVisitor visitor, String jobId) { if (visitor != null) { visitor.visitJobStatus(getJobStatus(jobId)); for (IJobStatus child : getChildren(jobId)) { accept(visitor, child.getJobId()); } } }
(MutableJobStatus) jobSuiteStatusSnapshot.getJobStatus(job); if (status.getState() == JobState.COMPLETED) { LOG.info("Job skipped: " + job.getId() + " (already completed)");