use of org.ow2.proactive.scheduler.common.job.JobInfo in project scheduling by ow2-proactive.
the class SchedulerEventBroadcaster method jobStateUpdatedEvent.
@Override
public void jobStateUpdatedEvent(NotificationData<JobInfo> notification) {
logEvent(notification);
broadcast(new EventNotification(EventNotification.Action.JOB_STATE_UPDATED, eventTypeName(notification), notification.getData()));
}
use of org.ow2.proactive.scheduler.common.job.JobInfo in project scheduling by ow2-proactive.
the class ClientJobStateTest method createJobState.
private JobState createJobState(final JobInfoImpl jobInfo) {
return new JobState() {
@Override
public void update(TaskInfo info) {
}
@Override
public void update(JobInfo jobInfo) {
}
@Override
public JobInfo getJobInfo() {
return jobInfo;
}
@Override
public List<TaskState> getTasks() {
List<TaskState> tasks = new ArrayList<>(0);
tasks.add(new TaskState() {
@Override
public void update(TaskInfo taskInfo) {
}
@Override
public List<TaskState> getDependences() {
return null;
}
@Override
public TaskInfo getTaskInfo() {
TaskInfoImpl taskInfo = new TaskInfoImpl();
taskInfo.setJobInfo(jobInfo);
taskInfo.setTaskId(TaskIdImpl.createTaskId(jobInfo.getJobId(), "task", 1));
return taskInfo;
}
@Override
public int getMaxNumberOfExecutionOnFailure() {
return 0;
}
@Override
public TaskState replicate() throws Exception {
return null;
}
@Override
public int getIterationIndex() {
return 0;
}
@Override
public int getReplicationIndex() {
return 0;
}
});
return tasks;
}
@Override
public Map<TaskId, TaskState> getHMTasks() {
return null;
}
@Override
public String getOwner() {
return null;
}
@Override
public JobType getType() {
return null;
}
};
}
use of org.ow2.proactive.scheduler.common.job.JobInfo in project scheduling by ow2-proactive.
the class JobData method toJobInfo.
JobInfo toJobInfo() {
JobId jobIdInstance = new JobIdImpl(getId(), getJobName());
JobInfoImpl jobInfo = createJobInfo(jobIdInstance);
return jobInfo;
}
use of org.ow2.proactive.scheduler.common.job.JobInfo in project scheduling by ow2-proactive.
the class JobData method createJobInfo.
JobInfoImpl createJobInfo(JobId jobId) {
JobInfoImpl jobInfo = new JobInfoImpl();
jobInfo.setJobId(jobId);
jobInfo.setJobOwner(getOwner());
jobInfo.setStatus(getStatus());
jobInfo.setTotalNumberOfTasks(getTotalNumberOfTasks());
jobInfo.setNumberOfPendingTasks(getNumberOfPendingTasks());
jobInfo.setNumberOfRunningTasks(getNumberOfRunningTasks());
jobInfo.setNumberOfFinishedTasks(getNumberOfFinishedTasks());
jobInfo.setNumberOfFailedTasks(getNumberOfFailedTasks());
jobInfo.setNumberOfFaultyTasks(getNumberOfFaultyTasks());
jobInfo.setNumberOfInErrorTasks(getNumberOfInErrorTasks());
jobInfo.setPriority(getPriority());
jobInfo.setRemovedTime(getRemovedTime());
jobInfo.setStartTime(getStartTime());
jobInfo.setInErrorTime(getInErrorTime());
jobInfo.setFinishedTime(getFinishedTime());
jobInfo.setSubmittedTime(getSubmittedTime());
jobInfo.setRemovedTime(getRemovedTime());
jobInfo.setLastUpdatedTime(getLastUpdatedTime());
if (isToBeRemoved()) {
jobInfo.setToBeRemoved();
}
jobInfo.setGenericInformation(getGenericInformation());
jobInfo.setVariables(createVariablesStringMap());
return jobInfo;
}
use of org.ow2.proactive.scheduler.common.job.JobInfo in project scheduling by ow2-proactive.
the class JobData method toInternalJob.
InternalJob toInternalJob() {
JobId jobIdInstance = new JobIdImpl(getId(), getJobName());
JobInfoImpl jobInfo = createJobInfo(jobIdInstance);
InternalJob internalJob = new InternalTaskFlowJob();
internalJob.setCredentials(getCredentials());
internalJob.setJobInfo(jobInfo);
internalJob.setGenericInformation(getGenericInformation());
internalJob.setVariables(variablesToJobVariables());
internalJob.setProjectName(getProjectName());
internalJob.setOwner(getOwner());
internalJob.setDescription(getDescription());
internalJob.setInputSpace(getInputSpace());
internalJob.setOutputSpace(getOutputSpace());
internalJob.setGlobalSpace(getGlobalSpace());
internalJob.setUserSpace(getGlobalSpace());
internalJob.setMaxNumberOfExecution(getMaxNumberOfExecution());
internalJob.setOnTaskError(OnTaskError.getInstance(this.onTaskErrorString));
internalJob.setScheduledTimeForRemoval(getScheduledTimeForRemoval());
return internalJob;
}
Aggregations