Search in sources :

Example 6 with JobInfo

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()));
}
Also used : EventNotification(org.ow2.proactive_grid_cloud_portal.scheduler.dto.eventing.EventNotification)

Example 7 with JobInfo

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;
        }
    };
}
Also used : TaskInfo(org.ow2.proactive.scheduler.common.task.TaskInfo) TaskId(org.ow2.proactive.scheduler.common.task.TaskId) JobInfo(org.ow2.proactive.scheduler.common.job.JobInfo) ArrayList(java.util.ArrayList) JobState(org.ow2.proactive.scheduler.common.job.JobState) TaskInfoImpl(org.ow2.proactive.scheduler.task.TaskInfoImpl) ArrayList(java.util.ArrayList) List(java.util.List) TaskState(org.ow2.proactive.scheduler.common.task.TaskState) IOException(java.io.IOException) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Example 8 with JobInfo

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

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

Example 10 with 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;
}
Also used : InternalJob(org.ow2.proactive.scheduler.job.InternalJob) JobIdImpl(org.ow2.proactive.scheduler.job.JobIdImpl) JobInfoImpl(org.ow2.proactive.scheduler.job.JobInfoImpl) InternalTaskFlowJob(org.ow2.proactive.scheduler.job.InternalTaskFlowJob) JobId(org.ow2.proactive.scheduler.common.job.JobId)

Aggregations

JobInfo (org.ow2.proactive.scheduler.common.job.JobInfo)31 JobId (org.ow2.proactive.scheduler.common.job.JobId)20 Test (org.junit.Test)17 ArrayList (java.util.ArrayList)9 Scheduler (org.ow2.proactive.scheduler.common.Scheduler)9 TaskInfo (org.ow2.proactive.scheduler.common.task.TaskInfo)9 JobInfoImpl (org.ow2.proactive.scheduler.job.JobInfoImpl)9 JobState (org.ow2.proactive.scheduler.common.job.JobState)8 TaskState (org.ow2.proactive.scheduler.common.task.TaskState)8 InternalJob (org.ow2.proactive.scheduler.job.InternalJob)8 TaskInfoImpl (org.ow2.proactive.scheduler.task.TaskInfoImpl)8 TaskId (org.ow2.proactive.scheduler.common.task.TaskId)7 File (java.io.File)6 HashMap (java.util.HashMap)5 JobFilterCriteria (org.ow2.proactive.scheduler.common.JobFilterCriteria)5 NotConnectedException (org.ow2.proactive.scheduler.common.exception.NotConnectedException)5 PermissionException (org.ow2.proactive.scheduler.common.exception.PermissionException)5 JobResult (org.ow2.proactive.scheduler.common.job.JobResult)5 TaskResult (org.ow2.proactive.scheduler.common.task.TaskResult)5 InternalTask (org.ow2.proactive.scheduler.task.internal.InternalTask)5