Search in sources :

Example 1 with YOU_DO_NOT_HAVE_PERMISSION_TO_SUBMIT_A_JOB

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;
    }
}
Also used : InternalJob(org.ow2.proactive.scheduler.job.InternalJob) UserIdentificationImpl(org.ow2.proactive.scheduler.job.UserIdentificationImpl) FileSystemException(org.objectweb.proactive.extensions.dataspaces.exceptions.FileSystemException) KeyException(java.security.KeyException) UnknownJobException(org.ow2.proactive.scheduler.common.exception.UnknownJobException) TaskCouldNotRestartException(org.ow2.proactive.scheduler.common.exception.TaskCouldNotRestartException) InvalidChannelException(org.ow2.proactive.scheduler.synchronization.InvalidChannelException) JobCreationException(org.ow2.proactive.scheduler.common.exception.JobCreationException) PermissionException(org.ow2.proactive.scheduler.common.exception.PermissionException) NotConnectedException(org.ow2.proactive.scheduler.common.exception.NotConnectedException) AlreadyConnectedException(org.ow2.proactive.scheduler.common.exception.AlreadyConnectedException) UnknownTaskException(org.ow2.proactive.scheduler.common.exception.UnknownTaskException) TaskCouldNotStartException(org.ow2.proactive.scheduler.common.exception.TaskCouldNotStartException) JobValidationException(org.ow2.proactive.scheduler.common.exception.JobValidationException) JobAlreadyFinishedException(org.ow2.proactive.scheduler.common.exception.JobAlreadyFinishedException) SubmissionClosedException(org.ow2.proactive.scheduler.common.exception.SubmissionClosedException) DatabaseManagerException(org.ow2.proactive.db.DatabaseManagerException) TaskSkippedException(org.ow2.proactive.scheduler.common.exception.TaskSkippedException) ProActiveException(org.objectweb.proactive.core.ProActiveException) SignalApiException(org.ow2.proactive.scheduler.signal.SignalApiException) SubmissionClosedException(org.ow2.proactive.scheduler.common.exception.SubmissionClosedException) ImmediateService(org.objectweb.proactive.annotation.ImmediateService)

Aggregations

KeyException (java.security.KeyException)1 ImmediateService (org.objectweb.proactive.annotation.ImmediateService)1 ProActiveException (org.objectweb.proactive.core.ProActiveException)1 FileSystemException (org.objectweb.proactive.extensions.dataspaces.exceptions.FileSystemException)1 DatabaseManagerException (org.ow2.proactive.db.DatabaseManagerException)1 AlreadyConnectedException (org.ow2.proactive.scheduler.common.exception.AlreadyConnectedException)1 JobAlreadyFinishedException (org.ow2.proactive.scheduler.common.exception.JobAlreadyFinishedException)1 JobCreationException (org.ow2.proactive.scheduler.common.exception.JobCreationException)1 JobValidationException (org.ow2.proactive.scheduler.common.exception.JobValidationException)1 NotConnectedException (org.ow2.proactive.scheduler.common.exception.NotConnectedException)1 PermissionException (org.ow2.proactive.scheduler.common.exception.PermissionException)1 SubmissionClosedException (org.ow2.proactive.scheduler.common.exception.SubmissionClosedException)1 TaskCouldNotRestartException (org.ow2.proactive.scheduler.common.exception.TaskCouldNotRestartException)1 TaskCouldNotStartException (org.ow2.proactive.scheduler.common.exception.TaskCouldNotStartException)1 TaskSkippedException (org.ow2.proactive.scheduler.common.exception.TaskSkippedException)1 UnknownJobException (org.ow2.proactive.scheduler.common.exception.UnknownJobException)1 UnknownTaskException (org.ow2.proactive.scheduler.common.exception.UnknownTaskException)1 InternalJob (org.ow2.proactive.scheduler.job.InternalJob)1 UserIdentificationImpl (org.ow2.proactive.scheduler.job.UserIdentificationImpl)1 SignalApiException (org.ow2.proactive.scheduler.signal.SignalApiException)1