Search in sources :

Example 31 with JobData

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);
}
Also used : ClientJobState(org.ow2.proactive.scheduler.job.ClientJobState)

Example 32 with JobData

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();
    }
}
Also used : InternalJob(org.ow2.proactive.scheduler.job.InternalJob) TaskId(org.ow2.proactive.scheduler.common.task.TaskId)

Example 33 with JobData

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");
}
Also used : TaskInfo(org.ow2.proactive.scheduler.common.task.TaskInfo) InternalJob(org.ow2.proactive.scheduler.job.InternalJob) TaskInfoImpl(org.ow2.proactive.scheduler.task.TaskInfoImpl)

Aggregations

InternalJob (org.ow2.proactive.scheduler.job.InternalJob)20 InternalTask (org.ow2.proactive.scheduler.task.internal.InternalTask)10 TaskFlowJob (org.ow2.proactive.scheduler.common.job.TaskFlowJob)8 Test (org.junit.Test)7 TaskId (org.ow2.proactive.scheduler.common.task.TaskId)7 UnknownJobException (org.ow2.proactive.scheduler.common.exception.UnknownJobException)5 UnknownTaskException (org.ow2.proactive.scheduler.common.exception.UnknownTaskException)5 TaskResultImpl (org.ow2.proactive.scheduler.task.TaskResultImpl)5 JobId (org.ow2.proactive.scheduler.common.job.JobId)4 SimpleTaskLogs (org.ow2.proactive.scheduler.common.task.SimpleTaskLogs)4 TaskInfo (org.ow2.proactive.scheduler.common.task.TaskInfo)4 TaskInfoImpl (org.ow2.proactive.scheduler.task.TaskInfoImpl)4 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 List (java.util.List)2 TaskAbortedException (org.ow2.proactive.scheduler.common.exception.TaskAbortedException)2 TaskPreemptedException (org.ow2.proactive.scheduler.common.exception.TaskPreemptedException)2 TaskRestartedException (org.ow2.proactive.scheduler.common.exception.TaskRestartedException)2 JobInfo (org.ow2.proactive.scheduler.common.job.JobInfo)2 JobVariable (org.ow2.proactive.scheduler.common.job.JobVariable)2