Package org.apache.uima.ducc.jd.client

Examples of org.apache.uima.ducc.jd.client.ThreadLocation


      DuccId jobDuccId = job.getDuccId();
      IDuccProcess process = job.getProcessMap().findProcess(nodeIP, PID);
      if(process != null) {
        DuccId processDuccId = process.getDuccId();
        jobDriver.accountingWorkItemIsDispatch(processDuccId);
        ThreadLocation threadLocation = jobDriver.getCasDispatchMap().get(casId);
        duccOut.debug(location, jobDuccId, processDuccId, "seqNo:"+threadLocation.getSeqNo()+" "+"casId:"+casId+" "+"node:"+nodeIP+" "+"PID:"+PID);
        WorkItem workItem = casWorkItemMap.get(casId);
        workItem.setProcessId(processDuccId);
        locationPendingMapRemove(threadLocation.getSeqNo(),casId);
      }
      else {
        NP casLocation = new NP(nodeIP, PID);
        ThreadLocation threadLocation = jobDriver.getCasDispatchMap().get(casId);
        locationPendingMapPut(threadLocation.getSeqNo(), casId, casLocation);
        DuccId processDuccId = null;
        duccOut.debug(location, jobDuccId, processDuccId, "seqNo:"+threadLocation.getSeqNo()+" "+"casId:"+casId+" "+"node:"+nodeIP+" "+"PID:"+PID);
      }
    }
    catch(Exception e) {
      duccOut.error(location, jobid, "location error?", e);
    }
View Full Code Here


   * IWorkItemMonitor
   */
 
  private ThreadLocation getThreadLocation(WorkItem workItem) {
    String location = "getThreadLocation";
    ThreadLocation threadLocation = null;
    try {
      threadLocation = getCasDispatchMap().get(workItem.getCasId());
    }
    catch(Exception e) {
      duccOut.warn(location, jobid, e);
View Full Code Here

 
  private String getThreadLocationInfo(WorkItem workItem) {
    String location = "getThreadLocationInfo";
    String retVal;
    try {
      ThreadLocation threadLocation = getThreadLocation(workItem);
      retVal = threadLocation.getInfo();
    }
    catch(Exception e) {
      duccOut.warn(location, jobid, e);
      retVal = "unknown";
    }
View Full Code Here

 
  private String getThreadLocationId(WorkItem workItem) {
    String location = "getThreadLocationId";
    String retVal;
    try {
      ThreadLocation threadLocation = getThreadLocation(workItem);
      retVal = threadLocation.getLocationId();
    }
    catch(Exception e) {
      duccOut.warn(location, jobid, e);
      retVal = "unknown";
    }
View Full Code Here

    DuccId djid = workItem.getJobId();
    DuccId dpid = workItem.getProcessId();
    try {
      String key = ""+workItem.getCAS().hashCode();
      if(casDispatchMap.containsKey(key)) {
        ThreadLocation threadLocation = casDispatchMap.get(key);
        if(threadLocation != null) {
          nodeId = threadLocation.getNodeId();
          pid = threadLocation.getProcessId();
        }
      }
      String message = "seqNo:"+workItem.getSeqNo()+" "+"wiId:"+workItem.getCasDocumentText()+" "+"node:"+nodeId+" "+"PID:"+pid;
      if(directive != null) {
        message += " "+"directive:"+directive;
View Full Code Here

      }
    }
  }

  public ThreadLocation getLostCas(String casId) {
    ThreadLocation retVal = null;
    synchronized(this) {
      if(casId != null) {
        retVal = lostMap.get(casId);
      }
    }
View Full Code Here

            driverStatusReport.resetWorkItemsPending();
          }
          break;
        }
        duccOut.debug(location, jobid, "queue:"+casTuple.getSeqno());
        ThreadLocation threadLocation = new ThreadLocation(""+casTuple.getSeqno());
        duccOut.debug(location, jobid, "action:ready "+threadLocation.getInfo());
        getCasDispatchMap().put(casTuple, threadLocation);
        Future<?> pendingWork = executor.submit(workItemFactory.create(casTuple));
        threadLocation.setPendingWork(pendingWork);
        workItemActive();
      }
    }
    catch(Exception e) {
      driverStatusReport.killJob(JobCompletionType.CanceledByDriver, new Rationale("job driver exception occurred: "+summarize(e)));
View Full Code Here

 
  // ==========
 
  private void remove(WorkItem workItem) {
    String location = "remove";
    ThreadLocation threadLocation = getThreadLocation(workItem);
    String nodeIP = "?";
    String PID = "?";
    if(threadLocation != null) {
      nodeIP = threadLocation.getNodeId();
      PID = threadLocation.getProcessId();
    }
    duccOut.debug(location, jobid, "seqNo:"+workItem.getSeqNo()+" "+"wiId:"+workItem.getCasDocumentText()+" "+"casId:"+workItem.getCasId()+" "+"node:"+nodeIP+" "+"PID:"+PID);
    casDispatchMap.remove(workItem.getCasId());
    casWorkItemMap.remove(workItem.getCasId());
  }
View Full Code Here

  private boolean isRetry(WorkItem workItem) {
    String location = "isRetry";
    boolean retVal = false;
    String key = ""+workItem.getCAS().hashCode();
    if(casDispatchMap.containsKey(key)) {
      ThreadLocation threadLocation = casDispatchMap.get(key);
      duccOut.debug(location, workItem.getJobId(), workItem.getProcessId(), "threadLocation:"+threadLocation);
      if(threadLocation != null) {
        String nodeId = threadLocation.getNodeId();
        String extendedProcessId = threadLocation.getProcessId();
        if(nodeId == null) {
          retVal = true;
        }
        else if(extendedProcessId == null) {
          retVal = true;
View Full Code Here

TOP

Related Classes of org.apache.uima.ducc.jd.client.ThreadLocation

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.