use of org.ow2.proactive_grid_cloud_portal.cli.json.FieldMetaDataView.Type in project scheduling by ow2-proactive.
the class SchedulerFrontendState method jobStateUpdated.
@Override
public synchronized void jobStateUpdated(String owner, NotificationData<JobInfo> notification) {
ClientJobState js = jobsMap.get(notification.getData().getJobId());
synchronized (js) {
js.update(notification.getData());
switch(notification.getEventType()) {
case JOB_PENDING_TO_RUNNING:
sState.pendingToRunning(js);
break;
case JOB_PAUSED:
case JOB_IN_ERROR:
case JOB_RESUMED:
case JOB_RESTARTED_FROM_ERROR:
case JOB_CHANGE_PRIORITY:
case TASK_REPLICATED:
case TASK_SKIPPED:
break;
case JOB_PENDING_TO_FINISHED:
sState.pendingToFinished(js);
// set this job finished, user can get its result
jobs.get(notification.getData().getJobId()).setFinished(true);
break;
case JOB_RUNNING_TO_FINISHED:
sState.runningToFinished(js);
// set this job finished, user can get its result
jobs.get(notification.getData().getJobId()).setFinished(true);
break;
case JOB_REMOVE_FINISHED:
// removing jobs from the global list : this job is no more managed
sState.removeFinished(js);
jobsMap.remove(js.getId());
jobs.remove(notification.getData().getJobId());
logger.debug("HOUSEKEEPING removed the finished job " + js.getId() + " from the SchedulerFrontEndState");
break;
default:
logger.warn("**WARNING** - Unconsistent update type received from Scheduler Core : " + notification.getEventType());
return;
}
dispatchJobStateUpdated(owner, notification);
new JobEmailNotification(js, notification).checkAndSend();
}
}
Aggregations