use of org.ow2.proactive.scheduler.core.SchedulerFrontendState.YOU_DO_NOT_HAVE_PERMISSION_TO_SUBMIT_A_JOB in project scheduling by ow2-proactive.
the class SchedulerFrontend method submit.
/**
* {@inheritDoc}
*/
@Override
@ImmediateService
public JobId submit(Job userJob) throws NotConnectedException, PermissionException, SubmissionClosedException, JobCreationException {
try {
if (logger.isDebugEnabled()) {
logger.debug("New job submission requested : " + userJob.getName());
}
long t0 = System.currentTimeMillis();
// check if the scheduler is stopped
if (!schedulingService.isSubmitPossible()) {
String msg = "Scheduler is stopped, cannot submit job";
logger.info(msg);
throw new SubmissionClosedException(msg);
}
long t1 = System.currentTimeMillis();
UserIdentificationImpl ident = frontendState.checkPermission("submit", YOU_DO_NOT_HAVE_PERMISSION_TO_SUBMIT_A_JOB);
long t2 = System.currentTimeMillis();
InternalJob job = frontendState.createJob(userJob, ident);
long t3 = System.currentTimeMillis();
schedulingService.submitJob(job);
long t4 = System.currentTimeMillis();
frontendState.jobSubmitted(job, ident);
long t5 = System.currentTimeMillis();
long d1 = t1 - t0;
long d2 = t2 - t1;
long d3 = t3 - t2;
long d4 = t4 - t3;
long d5 = t5 - t4;
logger.debug(String.format("timer;%d;%d;%d;%d;%d;%d", job.getId().longValue(), d1, d2, d3, d4, d5));
return job.getId();
} catch (Exception e) {
logger.warn("Error when submitting job.", e);
throw e;
}
}
Aggregations