Examples of SchedulingException


Examples of eu.stratosphere.nephele.jobmanager.scheduler.SchedulingException

        final Map.Entry<InstanceType, Integer> entry = it.next();

        final InstanceTypeDescription descr = availableInstances.get(entry.getKey());
        if (descr == null) {
          throw new SchedulingException("Unable to schedule job: No instance of type " + entry.getKey()
              + " available");
        }

        if (descr.getMaximumNumberOfAvailableInstances() != -1
            && descr.getMaximumNumberOfAvailableInstances() < entry.getValue().intValue()) {
          throw new SchedulingException("Unable to schedule job: " + entry.getValue().intValue()
              + " instances of type " + entry.getKey() + " required, but only "
              + descr.getMaximumNumberOfAvailableInstances() + " are available");
        }
      }
    }

    // Subscribe to job status notifications
    executionGraph.registerJobStatusListener(this);

    // Set state of each vertex for scheduled
    final ExecutionGraphIterator it2 = new ExecutionGraphIterator(executionGraph, true);
    while (it2.hasNext()) {

      final ExecutionVertex vertex = it2.next();
      vertex.registerExecutionListener(new LocalExecutionListener(this, vertex));
    }

    // Register the scheduler as an execution stage listener
    executionGraph.registerExecutionStageListener(this);

    // Add job to the job queue (important to add job to queue before requesting instances)
    synchronized (this.jobQueue) {
      this.jobQueue.add(executionGraph);
    }

    // Request resources for the first stage of the job

    final ExecutionStage executionStage = executionGraph.getCurrentExecutionStage();
    try {
      requestInstances(executionStage);
    } catch (InstanceException e) {
      final String exceptionMessage = StringUtils.stringifyException(e);
      LOG.error(exceptionMessage);
      this.jobQueue.remove(executionGraph);
      throw new SchedulingException(exceptionMessage);
    }
  }
View Full Code Here

Examples of eu.stratosphere.nephele.jobmanager.scheduler.SchedulingException

        final Map.Entry<InstanceType, Integer> entry = it.next();

        final InstanceTypeDescription descr = availableInstances.get(entry.getKey());
        if (descr == null) {
          throw new SchedulingException("Unable to schedule job: No instance of type " + entry.getKey()
              + " available");
        }

        if (descr.getMaximumNumberOfAvailableInstances() != -1
            && descr.getMaximumNumberOfAvailableInstances() < entry.getValue().intValue()) {
          throw new SchedulingException("Unable to schedule job: " + entry.getValue().intValue()
              + " instances of type " + entry.getKey() + " required, but only "
              + descr.getMaximumNumberOfAvailableInstances() + " are available");
        }
      }
    }

    // Subscribe to job status notifications
    executionGraph.registerJobStatusListener(this);

    // Register execution listener for each vertex
    final ExecutionGraphIterator it2 = new ExecutionGraphIterator(executionGraph, true);
    while (it2.hasNext()) {

      final ExecutionVertex vertex = it2.next();
      vertex.registerExecutionListener(new QueueExecutionListener(this, vertex));
    }

    // Register the scheduler as an execution stage listener
    executionGraph.registerExecutionStageListener(this);

    // Add job to the job queue (important to add job to queue before requesting instances)
    synchronized (this.jobQueue) {
      this.jobQueue.add(executionGraph);
    }

    // Request resources for the first stage of the job

    final ExecutionStage executionStage = executionGraph.getCurrentExecutionStage();
    try {
      requestInstances(executionStage);
    } catch (InstanceException e) {
      final String exceptionMessage = StringUtils.stringifyException(e);
      LOG.error(exceptionMessage);
      this.jobQueue.remove(executionGraph);
      throw new SchedulingException(exceptionMessage);
    }
  }
View Full Code Here

Examples of org.apache.uima.ducc.rm.scheduler.SchedulingException

            String pid = p.getPID();

            logger.info(methodName, jobid, "New process ", s.toString(), mem, state, pid);
            if ( ! s.update(jobid, mem, state, p.getTimeWindowInit(), p.getTimeWindowRun(), pid) ) {
                // TODO: probably change to just a warning and cancel the job - for now I want an attention-getter
                throw new SchedulingException(jobid, "Process assignemnt arrives for share " + s.toString() +
                                              " but jobid " + jobid + " does not match share " + s.getJob().getId());
            }
            //scheduler.signalGrowth(jobid, s);
            // sadly, the pid is almost always null here
            //logger.info(methodName, jobid,
            //            "New process arrives for share", s.toString(), "PID", pid);
        }
           
        // gone stuff in in the right side of the map
        Map<DuccId, IDuccProcess> rproc = diffmap.getRight();
        for ( IDuccProcess p : rproc .values()) {
            // these processes are done.  look up the job and tell it process complete.
            Share s = scheduler.getShare(p.getDuccId());
            IRmJob j = scheduler.getJob(jobid);
            if ( j == null ) {
                throw new SchedulingException(jobid, "Process completion arrives for share " + s.toString() +
                                              " but job " + jobid + "cannot be found.");
            }
            scheduler.signalCompletion(j, s);
            logger.info(methodName, jobid,
                         String.format("Process %5s", p.getPID()),
                         "Completion:", s.toString());
        }

        for( DuccMapValueDifference<IDuccProcess> pd: diffmap ) {
            IDuccProcess pl = pd.getLeft();
            IDuccProcess pr = pd.getRight();

            Share sl = scheduler.getShare(pl.getDuccId());
            Share sr = scheduler.getShare(pr.getDuccId());

            String shareL = ( sl == null ) ? "<none>" : sl.toString();
            String shareR = ( sr == null ) ? "<none>" : sr.toString();

            ITimeWindow initL = pl.getTimeWindowInit();
            ITimeWindow initR = pr.getTimeWindowInit();
            long init_timeL = (initL == null) ? 0 : initL.getElapsedMillis();
            long init_timeR = (initR == null) ? 0 : initR.getElapsedMillis();

            /** extreme debugging only*/
            if ( logger.isTrace() ) {
                logger.trace(methodName, jobid,
                             "\n\tReconciling. incoming.(pid, mem, state, share, initTime)",
                             pl.getPID(),
                             pl.getResidentMemory(),
                             pl.getProcessState(),
                             shareL,
                             init_timeL,
                             "\n\tReconciling. existing.(pid, mem, state, share, initTime)",
                             pr.getPID(),
                             pr.getResidentMemory(),
                             pr.getProcessState(),
                             shareR,
                             init_timeR
                             );
            } else {
                if ( (pr.getPID() == null) && (pl.getPID() != null) ) {
                    logger.trace(methodName, jobid,
                                String.format("Process %5s", pl.getPID()),
                                "PID assignement for share", shareL);
                }
                if ( pl.getProcessState() != pr.getProcessState() ) {
                    logger.info(methodName, jobid,
                                String.format("Process %5s", pl.getPID()), sl.toString(),
                                "State:", pr.getProcessState(), "->", pl.getProcessState(),
                                getElapsedTime(pr.getTimeWindowInit()), getElapsedTime(pr.getTimeWindowRun()));
                }
            }

            long mem = pl.getResidentMemory();
            ProcessState state = pl.getProcessState();
            String pid = pl.getPID();                       
            Share s = scheduler.getShare(pl.getDuccId());
            if ( pl.isActive() ) {
               
                if ( s == null ) {
                    // this can happen if a node dies and the share is purged so it's ok.
                    logger.warn(methodName, jobid, "Update for share from process", pl.getPID(), pl.getDuccId(), "but cannot find share.");
                    continue;
                }
               
                if ( s.isPurged() ) {
                    IRmJob j = scheduler.getJob(jobid);
                    scheduler.signalCompletion(j, s);
                    logger.info(methodName, jobid, "Process", pl.getPID(), "marked complete because it is purged. State:", state);
                }

                if ( ! s.update(jobid, mem, state, pl.getTimeWindowInit(), pl.getTimeWindowRun(), pid) ) {
                    // TODO: probably change to just a warning and cancel the job - for now I want an attention-getter
                    throw new SchedulingException(jobid, "Process update arrives for share " + s.toString() +
                                                  " but jobid " + jobid + " does not match job in share " + s.getJob().getId());
                }
                // logger.debug(methodName, jobid, "Process update to process ", pid, "mem", mem, "state", state, "is assigned for share", s.toString());

            } else if ( pl.isComplete() ) {
View Full Code Here

Examples of org.apache.uima.ducc.rm.scheduler.SchedulingException

                          logger.info(methodName, l.getDuccId(), "[SPR] State: ", r.getStateObject(), "->", l.getStateObject());
                      }
                      // for the moment, these guys have nothing to reconcile.
                      break;
                  case Undefined:
                      throw new SchedulingException(l.getDuccId(), "Work arrives as type Undefined - should have been filtered out by now.");                     
                }
            }
          
        }
View Full Code Here

Examples of org.axonframework.eventhandling.scheduling.SchedulingException

        QuartzScheduleToken tr = new QuartzScheduleToken(jobIdentifier, groupIdentifier);
        try {
            JobDetail jobDetail = buildJobDetail(eventMessage, new JobKey(jobIdentifier, groupIdentifier));
            scheduler.scheduleJob(jobDetail, buildTrigger(triggerDateTime, jobDetail.getKey()));
        } catch (SchedulerException e) {
            throw new SchedulingException("An error occurred while setting a timer for a saga", e);
        }
        return tr;
    }
View Full Code Here

Examples of org.axonframework.eventhandling.scheduling.SchedulingException

        try {
            if (!scheduler.deleteJob(jobKey(reference.getJobIdentifier(), reference.getGroupIdentifier()))) {
                logger.warn("The job belonging to this token could not be deleted.");
            }
        } catch (SchedulerException e) {
            throw new SchedulingException("An error occurred while cancelling a timer for a saga", e);
        }
    }
View Full Code Here

Examples of org.jboss.soa.esb.schedule.SchedulingException

                    transactionStrategy.rollbackOnly() ;
                }
                transactionStrategy.terminate() ;
            }
        } catch (final TransactionStrategyException tse) {
            throw new SchedulingException("Unexpected transaction strategy exception", tse) ;
        }
    }
View Full Code Here

Examples of org.nimbustools.api.services.rm.SchedulingException

            throws SchedulingException,
                   ResourceRequestDeniedException {

        if (!this.valid) {
            throw new SchedulingException("scheduler was instantiated " +
                    "incorrectly"); // note for future IoC muckers
        }

        if (coschedid != null && !this.slotManager.canCoSchedule()) {
            throw new ResourceRequestDeniedException("this " +
                    "scheduler can not coschedule, ensemble usage is not " +
                    "supported");
        }

        final int[] ids;
        try {
            ids = this.db.getNextTasktIds(numNodes);
        } catch (WorkspaceDatabaseException e) {
            throw new SchedulingException(e.getMessage(), e);
        }
        final String[] assocs;
        if (this.slotManager.isNeededAssociationsSupported()) {
            assocs = neededAssociations;
        } else {
            assocs = null;
        }

        // see CreationPending class comment
        this.creationPending.pending(ids);

        final NodeRequest req =
                new NodeRequest(ids, memory, cores, duration, assocs, resourcePool, groupid, creatorDN);

        try {

            if (coschedid == null) {
                return this.scheduleImpl(req, preemptable);
            } else {
                this.scheduleCoschedImpl(req, coschedid);
                return new Reservation(ids, null);
            }
           
        } catch (WorkspaceDatabaseException e) {
            this.creationPending.notpending(ids);
            throw new SchedulingException(e.getMessage(), e);
        } catch (ResourceRequestDeniedException e) {
            this.creationPending.notpending(ids);
            throw e;
        } catch (Throwable t) {
            this.creationPending.notpending(ids);
            throw new SchedulingException(t.getMessage(), t);
        }
    }
View Full Code Here

Examples of org.nimbustools.api.services.rm.SchedulingException

            throws SchedulingException,
                   ResourceRequestDeniedException {

        if (!this.valid) {
            throw new SchedulingException("scheduler was instantiated " +
                    "incorrectly"); // note for future IoC muckers
        }

        final Lock lock = lockManager.getLock(coschedid);

        try {
            lock.lockInterruptibly();
        } catch (InterruptedException e) {
            throw new SchedulingException(
                        new LockAcquisitionFailure(e));
        }

        try {
            this.proceedCoscheduleImpl(coschedid);
        } catch (WorkspaceDatabaseException e) {
            throw new SchedulingException(e.getMessage(), e);
        } finally {
            lock.unlock();
        }
    }
View Full Code Here

Examples of org.nimbustools.api.services.rm.SchedulingException

        if (sched == null) {
            return; // *** EARLY RETURN ***
        }

        if (sched.getDurationSeconds() < 0) {
            throw new SchedulingException(
                    "requested duration may not be less than zero");
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.