Package org.apache.uima.ducc.common.jd.plugin.IJdProcessExceptionHandler

Examples of org.apache.uima.ducc.common.jd.plugin.IJdProcessExceptionHandler.Directive


  }
 
  private boolean isError(WorkItem workItem, Exception e) {
    String location = "isError";
    boolean retVal = true;
    Directive directive = getDirective(workItem, e);
    String message = "seqNo:"+workItem.getSeqNo()+" "+"wiId:"+workItem.getCasDocumentText()+" "+"plugin exception handler "+"directive:"+directive+" "+"reason:"+directive.getReason();
    duccOut.debug(location, workItem.getJobId(), workItem.getProcessId(), message, e);
    switch(directive) {
    case ProcessContinue_CasNoRetry:
      duccOut.info(location, workItem.getJobId(), workItem.getProcessId(), message);
      break;
    case ProcessContinue_CasRetry:
      retVal = false;
      break;
    case ProcessStop_CasNoRetry:
      duccOut.info(location, workItem.getJobId(), workItem.getProcessId(), message);
      driverStatusReport.killProcess(workItem.getProcessId(),workItem.getCasId());
      break;
    case ProcessStop_CasRetry:
      driverStatusReport.killProcess(workItem.getProcessId(),workItem.getCasId());
      retVal = false;
      break;
    case JobStop:
      duccOut.info(location, workItem.getJobId(), workItem.getProcessId(), message);
      StringBuffer sb = new StringBuffer();
      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);
View Full Code Here


        processKey = parts[0]+":"+parts[1];
      }
    }
    Properties properties = new Properties();
    properties.put(JdProperties.SequenceNumber, ""+workItem.getSeqNo());
    Directive directive = jdProcessExceptionHandler.handle(processKey, workItem.getCAS(), e, properties);
    duccOut.debug(location, workItem.getJobId(), workItem.getProcessId(), "seqNo:"+workItem.getSeqNo()+" "+"wiId:"+workItem.getCasDocumentText()+" "+"directive:"+directive+" "+"reason:"+directive.getReason());
    return directive;
  }
View Full Code Here

    return;
  }

  private void employPluginExceptionHandler(WorkItem workItem, Exception e) {
    String location = "employPluginExceptionHandler";
    Directive directive = getDirective(workItem,e);
    String message = "seqNo:"+workItem.getSeqNo()+" "+"wiId:"+workItem.getCasDocumentText()+" "+"directive:"+directive+" "+"reason:"+directive.getReason();
    duccOut.debug(location, workItem.getJobId(), workItem.getProcessId(), message, e);
    switch(directive) {
    case ProcessContinue_CasNoRetry:
      duccOut.info(location, workItem.getJobId(), workItem.getProcessId(), message);
      workItemStateManager.error(workItem.getSeqNo());
      workItemError(workItem, e, directive);
      remove(workItem);
      recycleCAS(workItem);
      accountingWorkItemIsError(workItem.getProcessId());
      try {
        queueCASes(1,queue,workItemFactory);
      }
      catch(Exception exception) {
        duccOut.error(location, jobid, "processing error?", exception);
      }
      break;
    case ProcessContinue_CasRetry:
      retry(workItem);
      break;
    case ProcessStop_CasNoRetry:
      duccOut.info(location, workItem.getJobId(), workItem.getProcessId(), message);
      workItemStateManager.error(workItem.getSeqNo());
      workItemError(workItem, e, directive);
      remove(workItem);
      recycleCAS(workItem);
      accountingWorkItemIsError(workItem.getProcessId());
      break;
    case ProcessStop_CasRetry:
      retry(workItem);
      break;
    case JobStop:
      duccOut.info(location, workItem.getJobId(), workItem.getProcessId(), message);
      StringBuffer sb = new StringBuffer();
      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;
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.ducc.common.jd.plugin.IJdProcessExceptionHandler.Directive

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.