use of org.ow2.proactive.scheduler.common.job.JobState in project scheduling by ow2-proactive.
the class SchedulerFrontendState method getTaskState.
synchronized TaskState getTaskState(JobId jobId, String taskName) throws NotConnectedException, UnknownJobException, UnknownTaskException, PermissionException {
checkPermissions("getJobState", getIdentifiedJob(jobId), YOU_DO_NOT_HAVE_PERMISSION_TO_GET_THE_STATE_OF_THIS_TASK);
if (jobsMap.get(jobId) == null) {
throw new UnknownJobException(jobId);
}
TaskId taskId = null;
for (TaskId t : getJobTasks(jobId)) {
if (t.getReadableName().equals(taskName)) {
taskId = t;
}
}
if (taskId == null) {
throw new UnknownTaskException(taskName, jobId);
}
JobState jobState = jobsMap.get(jobId);
synchronized (jobState) {
TaskState ts = jobState.getHMTasks().get(taskId);
if (ts == null) {
throw new UnknownTaskException(taskId, jobId);
}
return ts;
}
}
use of org.ow2.proactive.scheduler.common.job.JobState in project scheduling by ow2-proactive.
the class SchedulerFrontendState method prepare.
/**
* Prepare the job in the frontend
*
* @param jobStates
* a temporary set of jobs
* @param js
* the current job to be prepared
* @param finished
* if the job is finished or not
*/
private void prepare(Set<JobState> jobStates, ClientJobState js, boolean finished) {
jobStates.add(js);
UserIdentificationImpl uIdent = new UserIdentificationImpl(js.getOwner());
IdentifiedJob ij = new IdentifiedJob(js.getId(), uIdent, js.getGenericInformation());
jobs.put(js.getId(), ij);
jobsMap.put(js.getId(), js);
ij.setFinished(finished);
}
use of org.ow2.proactive.scheduler.common.job.JobState in project scheduling by ow2-proactive.
the class SchedulerFrontendState method jobSubmitted.
@Override
public synchronized void jobSubmitted(JobState job) {
ClientJobState storedJobState = new ClientJobState(job);
jobsMap.put(job.getId(), storedJobState);
sState.update(storedJobState);
dispatchJobSubmitted(job);
}
Aggregations