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

Examples of org.apache.uima.ducc.transport.event.common.IRationale


    boolean ckpt = false;
    if(!job.isInitialized()) {
      long count = job.getProcessInitFailureCount();
      long limit = job.getProcessInitFailureLimit();
      if(count >= limit) {
        IRationale rationale = new Rationale("health monitor detected job initialization failures limit reached:"+limit);
        StateManager.getInstance().jobTerminate(job, JobCompletionType.ProcessInitializationFailure, rationale, ProcessDeallocationType.JobCanceled);
        logger.info(methodName, job.getDuccId(), JobCompletionType.ProcessInitializationFailure);
        ckpt = true;
      }
    }
View Full Code Here


    long cap = job.getProcessInitFailureCap();
    long procs = job.getAliveProcessCount();
    logger.debug(methodName, null, "fail.count:"+count+" "+"fail.cap:"+cap+" "+"alive.procs:"+procs);
    if(count >= cap) {
      if(job.getAliveProcessCount() == 0) {
        IRationale rationale = new Rationale("health monitor detected no resources assigned and job initialization failures cap reached:"+cap);
        StateManager.getInstance().jobTerminate(job, JobCompletionType.ProcessInitializationFailure, rationale, ProcessDeallocationType.JobCanceled);
        logger.info(methodName, job.getDuccId(), JobCompletionType.ProcessInitializationFailure);
        ckpt = true;
      }
    }
View Full Code Here

    long processFailureCount = job.getProcessFailureCount();
    if(processFailureCount > 0) {
      long limit = job.getProcessFailureLimit();
      if(job.isInitialized()) {
        if(processFailureCount >= limit) {
          IRationale rationale = new Rationale("health monitor detected job process failures limit reached:"+limit);
          StateManager.getInstance().jobTerminate(job, JobCompletionType.ProcessFailure, rationale, ProcessDeallocationType.JobCanceled);
          logger.info(methodName, job.getDuccId(), JobCompletionType.ProcessFailure);
          ckpt = true;
        }
      }
      else {
        IRationale rationale = new Rationale("health monitor detected job process failure during initialization of first process");
        StateManager.getInstance().jobTerminate(job, JobCompletionType.ProcessInitializationFailure, rationale, ProcessDeallocationType.JobCanceled);
        logger.info(methodName, job.getDuccId(), JobCompletionType.ProcessInitializationFailure);
        ckpt = true;
      }
    }
View Full Code Here

        Collection<IDuccProcess> processCollection = processMap.values();
        Iterator<IDuccProcess> iterator = processCollection.iterator();
        while(iterator.hasNext()) {
          IDuccProcess process = iterator.next();
          if(process.isComplete()) {
            IRationale rationale = new Rationale("health monitor detected job driver failed unexpectedly");
            StateManager.getInstance().jobTerminate(job, JobCompletionType.DriverProcessFailed, rationale, ProcessDeallocationType.JobCanceled);
            logger.info(methodName, job.getDuccId(), JobCompletionType.DriverProcessFailed);
            ckpt = true;
            break;
          }
View Full Code Here

            String reason = properties.getProperty(SpecificationProperties.key_reason);
            if(reason != null) {
              message += ": "+reason;
            }
          }
          IRationale rationale = new Rationale(message);
          JobCompletionType jobCompletionType = JobCompletionType.CanceledByUser;
          if(reqRole.equals(SpecificationProperties.key_role_administrator)) {
            jobCompletionType = JobCompletionType.CanceledByAdministrator;
          }
          stateManager.jobTerminate(duccWorkJob, jobCompletionType, rationale, ProcessDeallocationType.JobCanceled);
View Full Code Here

            break;
          default:
            type = "service";
            break;
          }
          IRationale rationale = new Rationale(type+" canceled by "+reqUser);
          JobCompletionType jobCompletionType = JobCompletionType.CanceledByUser;
          if(reqRole.equals(SpecificationProperties.key_role_administrator)) {
            jobCompletionType = JobCompletionType.CanceledByAdministrator;
          }
          stateManager.jobTerminate(duccWorkJob, jobCompletionType, rationale, ProcessDeallocationType.JobCanceled);
View Full Code Here

            }
            break;
          case Running:
          case Idle: 
            if(jdStatusReport.isKillJob()) {
              IRationale rationale = jdStatusReport.getJobCompletionRationale();
              switch(duccWorkJob.getJobState()) {
              case WaitingForServices:
                if(rationale == null) {
                  rationale = new Rationale("waiting for services");
                }
                else {
                  if(rationale.isSpecified()) {
                    String text = rationale.getText();
                    rationale = new Rationale(text+": "+"waiting for services");
                  }
                  else {
                    rationale = new Rationale("waiting for services");
                  }
View Full Code Here

            case Stopped:
                        case Stopping:
              stateJobAccounting.stateChange(duccWorkJob, JobState.Completing);
              duccWorkJob.getStandardInfo().setDateOfCompletion(TimeStamp.getCurrentMillis());
              String sdm = getServiceDependencyMessages(services)
              IRationale rationale = new Rationale();
              if(sdm != null) {
                rationale = new Rationale("service manager reported "+sdm);
              }
              stateJobAccounting.complete(duccWorkJob, JobCompletionType.ServicesUnavailable, rationale);
              changes++;
View Full Code Here

                    }
                    break;
                  default:
                    if(inventoryProcess.isComplete()) {
                      OrchestratorCommonArea.getInstance().getProcessAccounting().deallocate(job,ProcessDeallocationType.Stopped);
                      IRationale rationale = new Rationale("state manager reported as normal completion");
                      int errors = job.getSchedulingInfo().getIntWorkItemsError();
                      int lost = job.getSchedulingInfo().getIntWorkItemsLost();
                      if(errors > 0) {
                        setCompletionIfNotAlreadySet(job, JobCompletionType.Error, new Rationale("state manager detected error work items="+errors));
                      }
View Full Code Here

        Iterator<DuccId> iterator = map.keySet().iterator();
        while(iterator.hasNext()) {
          DuccId key = iterator.next();
          IDuccProcess process = map.get(key);
          int code = process.getProcessExitCode();
          IRationale exitCode = new Rationale("code="+code);
          switch(service.getCompletionType()) {
          case Undefined:
            service.setCompletion(JobCompletionType.ProgramExit, exitCode);
            service.getStandardInfo().setDateOfCompletion(TimeStamp.getCurrentMillis());
            break;
View Full Code Here

TOP

Related Classes of org.apache.uima.ducc.transport.event.common.IRationale

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.