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

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


          if(todo > 0) {
            if(capacity > todo) {
              duccOut.debug(location, jobid, "capacity:"+capacity+" "+"todo:"+todo);
              Enumeration<WorkItem> workItems = casWorkItemMap.elements();
              while(workItems.hasMoreElements()) {
                WorkItem workItem = workItems.nextElement();
                int seqNo = workItem.getSeqNo();
                String casId = workItem.getCasId();
                if(workItem.getCallbackState().isPendingCallback()) {
                  long sTime = workItem.getTimeWindow().getStartLong();
                  long cTime = System.currentTimeMillis();
                  long mTime = 1000*60*lostTimeout;
                  long tdiff = cTime - sTime;
                  if(tdiff > mTime) {
                    duccOut.warn(location, null, "reaping (no callback) seqNo:"+seqNo+" "+"casId:"+casId+" "+"tdiff:"+tdiff);
                    registerLostCas(workItem.getCasId(), getCasDispatchMap().get(casId));
                    workItem.lost();
                  }
                }
              }
            }
          }
View Full Code Here


  private void removeLocations(ArrayList<WorkItem> removalsList) {
    String location = "removeLocations";
    try {
      Iterator<WorkItem> iterator = removalsList.iterator();
      while(iterator.hasNext()) {
        WorkItem workItem = iterator.next();
        locationPendingMapRemove(""+workItem.getSeqNo(), workItem.getCasId());
        duccOut.debug(location, null, workItem.getCasId());
      }
    }
    catch(Exception e) {
      duccOut.error(location, null, "location error?", e);
    }
View Full Code Here

      Iterator<Entry<String, NP>> iterator = casLocationPendingMap.entrySet().iterator();
      duccOut.trace(location, jobDuccId, iterator.hasNext());
      while(iterator.hasNext()) {
        Entry<String, NP> entry = iterator.next();
        String casId = entry.getKey();
        WorkItem workItem = casWorkItemMap.get(casId);
        String seqNo = null;
        if(workItem != null) {
          seqNo = ""+workItem.getSeqNo();
        }
        String nodeIP = entry.getValue().getNodeIP();
        if(nodeIP == null) {
          DuccId processDuccId = null;
          duccOut.trace(location, jobDuccId, processDuccId, "seqNo:"+seqNo+" "+"casId:"+casId);
          continue;
        }
        String PID = entry.getValue().getPID();
        if(PID == null) {
          DuccId processDuccId = null;
          duccOut.trace(location, jobDuccId, processDuccId, "seqNo:"+seqNo+" "+"casId:"+casId+" "+"node:"+nodeIP);
          continue;
        }
        DuccId processDuccId = null;
        IDuccProcess process = job.getProcessMap().findProcess(nodeIP, PID);
        if(process != null) {
          processDuccId = process.getDuccId();
          jobDriver.accountingWorkItemIsDispatch(processDuccId);
          workItem.setProcessId(processDuccId);
          removeList.add(workItem);
          duccOut.debug(location, jobDuccId, processDuccId, "seqNo:"+seqNo+" "+"casId:"+casId+" "+"node:"+nodeIP+" "+"PID:"+PID);
          continue;
        }
        duccOut.trace(location, jobDuccId, processDuccId, "seqNo:"+seqNo+" "+"casId:"+casId+" "+"node:"+nodeIP+" "+"PID:"+PID);
View Full Code Here

      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);
View Full Code Here

  }
 
 
  public WorkItem getWorkItem(String casId) {
    String location = "getWorkItem";
    WorkItem workItem = null;
    if(casId != null) {
      workItem = casWorkItemMap.get(casId);
      if(workItem == null) {
        duccOut.warn(location, jobid, casId);
      }
View Full Code Here

TOP

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

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.