Search in sources :

Example 21 with TaskInfoImpl

use of org.ow2.proactive.scheduler.task.TaskInfoImpl in project scheduling by ow2-proactive.

the class LiveJobs method updateTaskPausedOnerrorState.

private void updateTaskPausedOnerrorState(InternalJob job, TaskId taskToUpdate) {
    try {
        InternalTask t = job.getTask(taskToUpdate);
        TaskInfo ti = new TaskInfoImpl((TaskInfoImpl) t.getTaskInfo());
        listener.taskStateUpdated(job.getOwner(), new NotificationData<>(SchedulerEvent.TASK_IN_ERROR, ti));
    } catch (UnknownTaskException e) {
        logger.error(e);
    }
}
Also used : TaskInfo(org.ow2.proactive.scheduler.common.task.TaskInfo) UnknownTaskException(org.ow2.proactive.scheduler.common.exception.UnknownTaskException) InternalTask(org.ow2.proactive.scheduler.task.internal.InternalTask) TaskInfoImpl(org.ow2.proactive.scheduler.task.TaskInfoImpl)

Example 22 with TaskInfoImpl

use of org.ow2.proactive.scheduler.task.TaskInfoImpl 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

TaskInfoImpl (org.ow2.proactive.scheduler.task.TaskInfoImpl)21 TaskId (org.ow2.proactive.scheduler.common.task.TaskId)15 TaskInfo (org.ow2.proactive.scheduler.common.task.TaskInfo)9 InternalJob (org.ow2.proactive.scheduler.job.InternalJob)9 InternalTask (org.ow2.proactive.scheduler.task.internal.InternalTask)9 UnknownTaskException (org.ow2.proactive.scheduler.common.exception.UnknownTaskException)8 ArrayList (java.util.ArrayList)7 JobIdImpl (org.ow2.proactive.scheduler.job.JobIdImpl)7 Test (org.junit.Test)6 UnknownJobException (org.ow2.proactive.scheduler.common.exception.UnknownJobException)6 TaskResultImpl (org.ow2.proactive.scheduler.task.TaskResultImpl)6 JobId (org.ow2.proactive.scheduler.common.job.JobId)5 InternalTaskFlowJob (org.ow2.proactive.scheduler.job.InternalTaskFlowJob)5 ExecuterInformation (org.ow2.proactive.scheduler.task.internal.ExecuterInformation)5 InternalScriptTask (org.ow2.proactive.scheduler.task.internal.InternalScriptTask)5 JobInfo (org.ow2.proactive.scheduler.common.job.JobInfo)4 JobInfoImpl (org.ow2.proactive.scheduler.job.JobInfoImpl)3 JobState (org.ow2.proactive.scheduler.common.job.JobState)2 TaskState (org.ow2.proactive.scheduler.common.task.TaskState)2 ChangedTasksInfo (org.ow2.proactive.scheduler.job.ChangedTasksInfo)2