Package org.apache.uima.ducc.transport.event.common.IProcessState

Examples of org.apache.uima.ducc.transport.event.common.IProcessState.ProcessState


          "Interrupted While Awaiting Termination of StdOutReader and StdErrReader Threads");
    }

    String reason = getDuccProcess().getReasonForStoppingProcess();

    ProcessState pstate = getDuccProcess().getProcessState();
        boolean initError = (reason != null && (reason
        .equals(ReasonForStoppingProcess.FailedInitialization
            .toString()) || reason
        .equals(ReasonForStoppingProcess.InitializationTimeout
            .toString())));
View Full Code Here


          IDuccProcessMap processMap = job.getProcessMap();
          Iterator<DuccId> iteratorP = processMap.keySet().iterator();
          while(iteratorP.hasNext()) {
            DuccId jpid = iteratorP.next();
            IDuccProcess jp = processMap.get(jpid);
            ProcessState processState = jp.getProcessState();
            switch(processState) {
            case Starting:
            case Initializing:
            case Running:
              NodeIdentity nodeIdentity = jp.getNodeIdentity();
View Full Code Here

          IDuccProcessMap processMap = service.getProcessMap();
          Iterator<DuccId> iteratorP = processMap.keySet().iterator();
          while(iteratorP.hasNext()) {
            DuccId jpid = iteratorP.next();
            IDuccProcess jp = processMap.get(jpid);
            ProcessState processState = jp.getProcessState();
            switch(processState) {
            case Starting:
            case Initializing:
            case Running:
              NodeIdentity nodeIdentity = jp.getNodeIdentity();
View Full Code Here

        IDuccProcessMap     pm = de.getProcessMap();

        if ( (pm.size() > 0) && !job.isCompleted() ) {          // need to recover, apparently RM crashed. hmph.
            for ( IDuccProcess proc : pm.values() ) {          // build up Shares from the incoming state

                ProcessState state = proc.getProcessState();               
                String pid = proc.getPID();                       
                NodeIdentity ni = proc.getNodeIdentity();

                if ( proc.isComplete() ) {
                    logger.debug(methodName, j.getId(), "Skipping process", pid, "on", ni.getName(), "beacause state is", state);
View Full Code Here

            // simply update the share with the information.  we pass in the jobid as a sanity check so
            // we can crash or at least complain loudly on mismatch.

            Share s = scheduler.getShare(p.getDuccId());
            long mem = p.getResidentMemory();
            ProcessState state = p.getProcessState();
            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 ) {
View Full Code Here

                        IDuccProcessMap pm = de.getProcessMap();
                        logger.info(methodName, w.getDuccId(), "Receive:", prefix, w.getDuccType(), w.getStateObject(), "processes[", pm.size(), "] Completed:", w.isCompleted());

                        for ( IDuccProcess proc : pm.values() ) {
                            String pid = proc.getPID();
                            ProcessState state = proc.getProcessState();
                            Node n = proc.getNode();
                            if ( n == null ) {
                                logger.info(methodName, w.getDuccId(), "   Process[", pid, "] state [", state, "] is complete[", proc.isComplete(), "] Node [N/A] mem[N/A");
                            } else {
                                long mem = n .getNodeMetrics().getNodeMemory().getMemTotal();
View Full Code Here

    return retVal;
  }
 
  private boolean isFailedProcess(IDuccProcess process) {
    boolean retVal = false;
    ProcessState processState = process.getProcessState();
    String reason = process.getReasonForStoppingProcess();
    switch(processState) {
    case Failed:
    case Stopped:
    case Killed:
View Full Code Here

TOP

Related Classes of org.apache.uima.ducc.transport.event.common.IProcessState.ProcessState

Copyright © 2018 www.massapicom. 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.