use of org.ow2.proactive.scheduler.core.db.JobData in project scheduling by ow2-proactive.
the class LiveJobs method jobSubmitted.
void jobSubmitted(InternalJob job) {
job.prepareTasks();
job.submitAction();
dbManager.newJobSubmitted(job);
ClientJobState clientJobState = new ClientJobState(job);
jobs.put(job.getId(), new JobData(job));
listener.jobSubmitted(clientJobState);
}
use of org.ow2.proactive.scheduler.core.db.JobData in project scheduling by ow2-proactive.
the class LiveJobs method pauseJob.
boolean pauseJob(JobId jobId) {
JobData jobData = lockJob(jobId);
if (jobData == null) {
return false;
}
try {
InternalJob job = jobData.job;
Set<TaskId> updatedTasks = job.setPaused();
if (!updatedTasks.isEmpty()) {
jlogger.info(jobId, "has just been paused.");
dbManager.updateJobAndTasksState(job);
updateTasksInSchedulerState(job, updatedTasks);
}
// update tasks events list and send it to front-end
updateJobInSchedulerState(job, SchedulerEvent.JOB_PAUSED);
return !updatedTasks.isEmpty();
} finally {
jobData.unlock();
}
}
use of org.ow2.proactive.scheduler.core.db.JobData in project scheduling by ow2-proactive.
the class LiveJobs method restartTaskOnError.
private void restartTaskOnError(JobData jobData, InternalTask task, TaskStatus status, TaskResultImpl result, long waitTime, TerminationData terminationData) {
InternalJob job = jobData.job;
tlogger.info(task.getId(), "node Exclusion : restart mode is '" + task.getRestartTaskOnError() + "'");
if (task.getRestartTaskOnError().equals(RestartMode.ELSEWHERE)) {
task.setNodeExclusion(task.getExecuterInformation().getNodes());
}
task.setStatus(status);
job.newWaitingTask();
dbManager.updateAfterTaskFinished(job, task, result);
listener.taskStateUpdated(job.getOwner(), new NotificationData<TaskInfo>(SchedulerEvent.TASK_WAITING_FOR_RESTART, new TaskInfoImpl((TaskInfoImpl) task.getTaskInfo())));
terminationData.addRestartData(task.getId(), waitTime);
logger.info("END restartTaskOnError");
}
Aggregations