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

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


    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

            duccOut.info(location, jobid, "user specified handler = "+jdProcessExceptionHandlerClassName);
          }
          catch (Exception e) {
            duccOut.error(location, jobid, e);
            duccErr.error(location, jobid, e);
            driverStatusReport.setInitializingFailed(new Rationale("job driver exception occurred: "+summarize(e)));
            terminate();
            throw new JobDriverTerminateException("initialize failed", e);
          }
        }
        else {
          duccOut.info(location, jobid, "default handler = "+JdProcessExceptionHandler.class.getName());
        }
      }
    }
    catch(JobDriverTerminateException e) {
      throw e;
    }
    catch(Exception e) {
      duccOut.error(location, jobid, e);
      duccErr.error(location, jobid, e);
      driverStatusReport.setInitializingFailed(new Rationale("job driver exception occurred: "+summarize(e)));
      terminate();
      throw new JobDriverTerminateException("initialize failed", e);
    }
  }
View Full Code Here

        }
      }
      else {
        duccOut.error(location, jobid, "not runnable");
        duccErr.error(location, jobid, "not runnable");
        driverStatusReport.setInitializingFailed(new Rationale("job driver not runnable"));
        terminate();
        throw new JobDriverTerminateException("not runnable");
      }
      int activeCount = getWorkItemActiveCount();
      if(getWorkItemActiveCount() > 0) {
View Full Code Here

      driverStatusReport.setInitializingCompleted();
    }
    catch(Exception e) {
      duccOut.error(location, jobid, e);
      duccErr.error(location, jobid, e);
      driverStatusReport.setInitializingFailed(new Rationale("job driver exception occurred: "+summarize(e)));
      terminate();
      throw new JobDriverTerminateException("initialize failed", e);
    }
  }
View Full Code Here

        threadLocation.setPendingWork(pendingWork);
        workItemActive();
      }
    }
    catch(Exception e) {
      driverStatusReport.killJob(JobCompletionType.CanceledByDriver, new Rationale("job driver exception occurred: "+summarize(e)));
      driverStatusReport.countWorkItemsProcessingError();
      duccOut.error(location, jobid, "error fetching next CAS from CR",e);
      duccErr.error(location, jobid, "error fetching next CAS from CR",e);
      throw new JobDriverTerminateException("error fetching next CAS from CR", e);
    }
View Full Code Here

      driverStatusReport.setAtLeastOneService();
    }
    else {
      int failures = getJob().getFailedUnexpectedProcessCount();
      if(failures >= MAX_INIT_FAILURES) {
        driverStatusReport.setExcessiveInitializationFailures(new Rationale("job driver initialization failures limit reached:"+MAX_INIT_FAILURES));
        duccOut.error(location, jobid, "Initialization failures limit reached: "+MAX_INIT_FAILURES);
        terminate();
        throw new JobDriverTerminateException("excessive initialize failures");
      }
    }
View Full Code Here

      sb.append("job driver received JobStop from plugin error handler");
      if(directive.hasReason()) {
        sb.append(" with reason: ");
        sb.append(directive.getReason());
      }
      driverStatusReport.killJob(JobCompletionType.CanceledByDriver, new Rationale(sb.toString()));
      break;
    }
    duccOut.debug(location, workItem.getJobId(), workItem.getProcessId(), "retVal:"+retVal);
    return retVal;
  }
View Full Code Here

TOP

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

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.