Search in sources :

Example 91 with InternalTask

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

the class TerminateLoopHandlerTest method generateInternalTask.

private InternalTask generateInternalTask() {
    InternalJob job = new InternalTaskFlowJob("test-name", JobPriority.NORMAL, OnTaskError.CANCEL_JOB, "description");
    InternalTask internalTask = new InternalScriptTask(job);
    internalTask.setId(TaskIdImpl.createTaskId(new JobIdImpl(666L, "JobName"), "readableName", 555L));
    return internalTask;
}
Also used : InternalScriptTask(org.ow2.proactive.scheduler.task.internal.InternalScriptTask) InternalJob(org.ow2.proactive.scheduler.job.InternalJob) InternalTask(org.ow2.proactive.scheduler.task.internal.InternalTask) JobIdImpl(org.ow2.proactive.scheduler.job.JobIdImpl) InternalTaskFlowJob(org.ow2.proactive.scheduler.job.InternalTaskFlowJob)

Example 92 with InternalTask

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

the class TerminateLoopHandlerTest method genearteTaks.

private Map<TaskId, InternalTask> genearteTaks() {
    Map<TaskId, InternalTask> tempTasks = Maps.newHashMap();
    InternalTask internalTask = generateInternalTask();
    tempTasks.put(internalTask.getId(), internalTask);
    return tempTasks;
}
Also used : TaskId(org.ow2.proactive.scheduler.common.task.TaskId) InternalTask(org.ow2.proactive.scheduler.task.internal.InternalTask)

Example 93 with InternalTask

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

the class TerminateReplicateTaskHandlerTest method generateTasksWithBlock.

private Map<TaskId, InternalTask> generateTasksWithBlock() {
    Map<TaskId, InternalTask> tempTasks = Maps.newHashMap();
    InternalTask startTask = generateInternalTask(555L);
    startTask.setFlowBlock(FlowBlock.START);
    tempTasks.put(startTask.getId(), startTask);
    InternalTask internalTask2 = generateInternalTask(666L);
    tempTasks.put(internalTask2.getId(), internalTask2);
    internalTask2.addDependence(startTask);
    InternalTask internalTask3 = generateInternalTask(888L);
    tempTasks.put(internalTask3.getId(), internalTask3);
    internalTask3.addDependence(startTask);
    when(jobDescriptorImpl.getTaskChildren(startTask)).thenReturn(Lists.newArrayList(internalTask2, internalTask3));
    InternalTask endTask = generateInternalTask(999L);
    tempTasks.put(endTask.getId(), endTask);
    endTask.setFlowBlock(FlowBlock.END);
    when(jobDescriptorImpl.getTaskChildren(internalTask2)).thenReturn(Lists.newArrayList(endTask));
    when(jobDescriptorImpl.getTaskChildren(internalTask3)).thenReturn(Lists.newArrayList(endTask));
    endTask.addDependence(internalTask2);
    endTask.addDependence(internalTask3);
    InternalTask mergeTask = generateInternalTask(MERGE_TASK_ID);
    tempTasks.put(mergeTask.getId(), mergeTask);
    mergeTask.addDependence(endTask);
    InternalTask initiatorTask = generateInitiatorTask();
    startTask.addDependence(initiatorTask);
    tempTasks.put(initiatorTask.getId(), initiatorTask);
    return tempTasks;
}
Also used : TaskId(org.ow2.proactive.scheduler.common.task.TaskId) InternalTask(org.ow2.proactive.scheduler.task.internal.InternalTask)

Example 94 with InternalTask

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

the class TerminateReplicateTaskHandlerTest method generateInitiatorTask.

private InternalTask generateInitiatorTask() {
    InternalJob job = new InternalTaskFlowJob("initiator", JobPriority.NORMAL, OnTaskError.CANCEL_JOB, "description");
    InternalTask initiatorTask = new InternalScriptTask(job);
    initiatorTask.setId(TaskIdImpl.createTaskId(new JobIdImpl(666L, "JobName"), "readableName", 111L));
    initiatorTask.setReplicationIndex(1);
    return initiatorTask;
}
Also used : InternalScriptTask(org.ow2.proactive.scheduler.task.internal.InternalScriptTask) InternalJob(org.ow2.proactive.scheduler.job.InternalJob) InternalTask(org.ow2.proactive.scheduler.task.internal.InternalTask) JobIdImpl(org.ow2.proactive.scheduler.job.JobIdImpl) InternalTaskFlowJob(org.ow2.proactive.scheduler.job.InternalTaskFlowJob)

Example 95 with InternalTask

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

the class TerminateReplicateTaskHandlerTest method generateTasks.

private Map<TaskId, InternalTask> generateTasks() {
    Map<TaskId, InternalTask> tempTasks = Maps.newHashMap();
    InternalTask internalTask = generateInternalTask(555L);
    tempTasks.put(internalTask.getId(), internalTask);
    InternalTask mergeTask = generateInternalTask(MERGE_TASK_ID);
    tempTasks.put(mergeTask.getId(), mergeTask);
    InternalTask initiatorTask = generateInitiatorTask();
    internalTask.addDependence(initiatorTask);
    mergeTask.addDependence(internalTask);
    tempTasks.put(initiatorTask.getId(), initiatorTask);
    return tempTasks;
}
Also used : TaskId(org.ow2.proactive.scheduler.common.task.TaskId) InternalTask(org.ow2.proactive.scheduler.task.internal.InternalTask)

Aggregations

InternalTask (org.ow2.proactive.scheduler.task.internal.InternalTask)142 InternalJob (org.ow2.proactive.scheduler.job.InternalJob)74 Test (org.junit.Test)72 InternalScriptTask (org.ow2.proactive.scheduler.task.internal.InternalScriptTask)39 TaskId (org.ow2.proactive.scheduler.common.task.TaskId)37 TaskResultImpl (org.ow2.proactive.scheduler.task.TaskResultImpl)32 InternalTaskFlowJob (org.ow2.proactive.scheduler.job.InternalTaskFlowJob)31 ArrayList (java.util.ArrayList)30 JobIdImpl (org.ow2.proactive.scheduler.job.JobIdImpl)25 JobId (org.ow2.proactive.scheduler.common.job.JobId)22 TaskFlowJob (org.ow2.proactive.scheduler.common.job.TaskFlowJob)18 ExecuterInformation (org.ow2.proactive.scheduler.task.internal.ExecuterInformation)16 TaskInfoImpl (org.ow2.proactive.scheduler.task.TaskInfoImpl)13 UnknownTaskException (org.ow2.proactive.scheduler.common.exception.UnknownTaskException)12 HashMap (java.util.HashMap)10 UnknownJobException (org.ow2.proactive.scheduler.common.exception.UnknownJobException)10 ProActiveTest (org.ow2.tests.ProActiveTest)10 TaskInfo (org.ow2.proactive.scheduler.common.task.TaskInfo)9 HashSet (java.util.HashSet)8 SchedulerStateRecoverHelper (org.ow2.proactive.scheduler.core.db.SchedulerStateRecoverHelper)8