use of org.ow2.proactive.scheduler.common.task.TaskInfo in project scheduling by ow2-proactive.
the class LiveJobs method updateTasksInSchedulerState.
private void updateTasksInSchedulerState(InternalJob job, Set<TaskId> tasksToUpdate) {
for (TaskId tid : tasksToUpdate) {
try {
InternalTask t = job.getTask(tid);
TaskInfo ti = new TaskInfoImpl((TaskInfoImpl) t.getTaskInfo());
listener.taskStateUpdated(job.getOwner(), new NotificationData<>(SchedulerEvent.TASK_RUNNING_TO_FINISHED, ti));
} catch (UnknownTaskException e) {
logger.error(e);
}
}
}
use of org.ow2.proactive.scheduler.common.task.TaskInfo in project scheduling by ow2-proactive.
the class TaskData method toTaskState.
public TaskState toTaskState() {
TaskInfo taskInfo = toTaskInfo();
TaskStateImpl taskState = new TaskStateImpl();
taskState.update(taskInfo);
taskState.setName(getTaskName());
taskState.setDescription(getDescription());
taskState.setTag(getTag());
taskState.setIterationIndex(getIteration());
taskState.setReplicationIndex(getReplication());
taskState.setMaxNumberOfExecution(getMaxNumberOfExecution());
taskState.setParallelEnvironment(getParallelEnvironment());
taskState.setGenericInformation(getGenericInformation());
taskState.setVariables(variablesToTaskVariables());
return taskState;
}
use of org.ow2.proactive.scheduler.common.task.TaskInfo in project scheduling by ow2-proactive.
the class TaskData method createTaskInfo.
TaskInfoImpl createTaskInfo(JobIdImpl jobId) {
TaskId taskId = TaskIdImpl.createTaskId(jobId, getTaskName(), getId().getTaskId(), getTag());
TaskInfoImpl taskInfo = new TaskInfoImpl();
taskInfo.setTaskId(taskId);
taskInfo.setStatus(getTaskStatus());
taskInfo.setStartTime(getStartTime());
taskInfo.setProgress(0);
taskInfo.setInErrorTime(getInErrorTime());
taskInfo.setNumberOfExecutionOnFailureLeft(getNumberOfExecutionOnFailureLeft());
taskInfo.setNumberOfExecutionLeft(getNumberOfExecutionLeft());
taskInfo.setJobInfo(getJobData().toJobInfo());
taskInfo.setJobId(jobId);
taskInfo.setFinishedTime(getFinishedTime());
taskInfo.setScheduledTime(getScheduledTime());
taskInfo.setExecutionHostName(getExecutionHostName());
taskInfo.setExecutionDuration(getExecutionDuration());
return taskInfo;
}
use of org.ow2.proactive.scheduler.common.task.TaskInfo in project scheduling by ow2-proactive.
the class InternalJob method update.
@Override
public synchronized void update(JobInfo info) {
if (!getId().equals(info.getJobId())) {
throw new IllegalArgumentException("This job info is not applicable for this job. (expected id is '" + getId() + "' but was '" + info.getJobId() + "'");
}
// update job info
this.jobInfo = (JobInfoImpl) info;
// update skipped tasks
if (this.jobInfo.getTasksSkipped() != null) {
for (TaskId id : tasks.keySet()) {
if (this.jobInfo.getTasksSkipped().contains(id)) {
TaskInfoImpl taskInfo = (TaskInfoImpl) tasks.get(id).getTaskInfo();
taskInfo.setStatus(TaskStatus.SKIPPED);
}
}
}
}
use of org.ow2.proactive.scheduler.common.task.TaskInfo in project scheduling by ow2-proactive.
the class SubmitJob method taskStateUpdatedEvent.
public void taskStateUpdatedEvent(NotificationData<TaskInfo> notif) {
try {
System.out.println("Task '" + notif.getData().getTaskId() + "' result received !!");
TaskResult result = user.getTaskResult(notif.getData().getJobId(), notif.getData().getTaskId().getReadableName());
terminated++;
System.out.println("(" + terminated + ")Result value = " + result.value());
} catch (Throwable t) {
t.printStackTrace();
}
}
Aggregations