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

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


  private void reportIncomingStateForThisNode(DuccJobsStateEvent duccEvent) throws Exception {
    StringBuffer sb = new StringBuffer();
   
    for( IDuccJobDeployment jobDeployment : duccEvent.getJobList()) {
      if ( isTargetNodeForProcess(jobDeployment.getJdProcess()) ) {
        IDuccProcess process = jobDeployment.getJdProcess();
        sb.append("\nJD--> JobId:"+jobDeployment.getJobId()+" ProcessId:"+process.getDuccId()+" PID:"+process.getPID()+" Status:"+process.getProcessState() + " Resource State:"+process.getResourceState()+" isDeallocated:"+process.isDeallocated());
      }
      for( IDuccProcess process : jobDeployment.getJpProcessList() ) {
        if ( isTargetNodeForProcess(process) ) {
          sb.append("\n\tJob ID:"+jobDeployment.getJobId()+" ProcessId:"+process.getDuccId()+" PID:"+process.getPID()+" Status:"+process.getProcessState() + " Resource State:"+process.getResourceState()+" isDeallocated:"+process.isDeallocated());
        }
      }
    }
    logger.info("reportIncomingStateForThisNode",null,sb.toString());
  }
View Full Code Here


  public ArrayList<String> getSwappingMachines(IDuccWorkJob job) {
    ArrayList<String> retVal = new ArrayList<String>();
    DuccMachinesData.getInstance();
    IDuccProcessMap map = job.getProcessMap();
    for(DuccId duccId : map.keySet()) {
      IDuccProcess jp = map.get(duccId);
      switch(jp.getProcessState()) {
      case Starting:
      case Initializing:
      case Running:
        NodeIdentity nodeId = jp.getNodeIdentity();
        if(nodeId != null) {
          String ip = nodeId.getIp();
          if(DuccMachinesData.getInstance().isMachineSwapping(ip)) {
            if(!retVal.contains(nodeId.getName())) {
              retVal.add(nodeId.getName());
View Full Code Here

    String code = "?";
    if(map != null) {
      Iterator<DuccId> iterator = map.keySet().iterator();
      while(iterator.hasNext()) {
        DuccId key = iterator.next();
        IDuccProcess process = map.get(key);
        code = ""+process.getProcessExitCode();
        break;
      }
    }
    return code;
  }
View Full Code Here

                                                 "Exit Reason"));           
                System.out.println(underline);
            }

      for (DuccId id : pmap.keySet() ) {
        IDuccProcess idp = pmap.getProcess(id);
        String node = idp.getNodeIdentity().getName();
        String pid = idp.getPID();
                String exit_reason = idp.getReasonForStoppingProcess();

                long mem = idp.getResidentMemory();
        long memmax = idp.getResidentMemoryMax();
        long major_faults = idp.getMajorFaults();
        long swap_usage = idp.getSwapUsage();
        long max_swap_usage = idp.getSwapUsageMax();
        long cpu_time = idp.getCpuTime();
       
        long init_time = idp.getTimeWindowInit().getElapsedMillis();

        ProcessGarbageCollectionStats gcStats = idp.getGarbageCollectionStats();
                long gcCollectionCount = 0;
                long gcCollectionTime = 0;
                if ( gcStats != null ) {
                    gcCollectionCount = gcStats.getCollectionCount();
                    gcCollectionTime = gcStats.getCollectionTime();
                }
       
        IDuccProcessWorkItems idpw = idp.getProcessWorkItems();
                long wiDispatch = 0;
                long wiDone     = 0;
                long wiError    = 0;
                long wiRetry    = 0;
                long wiPreempt  = 0;                
View Full Code Here

        sb.append("0");
      }
      Iterator<DuccId> iterator = job.getProcessMap().keySet().iterator();
      while(iterator.hasNext()) {
        DuccId processId = iterator.next();
        IDuccProcess process = job.getProcessMap().get(processId);
        String node = process.getNodeIdentity().getName();
        nodeMap.put(node, 1);
      }
    }
    row.add(new JsonPrimitive(sb.toString()));
    // Size
View Full Code Here

    if(pDuccId == null) {
      duccOut.warn(location, getJobId(), casTuple.getDuccId(), "process ID null");
    }
    else {
      IDuccProcessMap processMap = getProcessMap();
      IDuccProcess process = processMap.getProcess(pDuccId);
      if(process == null) {
        duccOut.warn(location, getJobId(), casTuple.getDuccId(), "process is null");
      }
      else {
        if(process.isPreempted()) {
          jd.getDriverStatusReportLive().countWorkItemsPreempted();
          jd.accountingWorkItemIsPreempt(pDuccId);
          duccOut.debug(location, getJobId(), casTuple.getDuccId(), "preempted:t"+" "+"seqNo:"+casTuple.getSeqno()+" "+"wiId:"+casTuple.getCasDocumentText());
        }
        else {
View Full Code Here

      retVal = true;
      duccOut.warn(location, getJobId(), casTuple.getDuccId(), "process ID is null");
    }
    else {
      IDuccProcessMap processMap = getProcessMap();
      IDuccProcess process = processMap.getProcess(pDuccId);
      if(process == null) {
        retVal = true;
        duccOut.warn(location, getJobId(), casTuple.getDuccId(), "process is null");
      }
      else
        if(process.isDefunct()) {
          retVal = true;    // process ended, no wait necessary 
          duccOut.debug(location, getJobId(), casTuple.getDuccId(), "process is defunct");
        }
        else if(process.isPreempted()) { 
          retVal = false;    // process scheduled to die (by OR), wait
          duccOut.debug(location, getJobId(), casTuple.getDuccId(), "process is preempted");
        }
        else if(jd.getDriverStatusReportLive().isKillProcess(pDuccId)) {
          retVal = false;    // process scheduled to die (by JD), wait
View Full Code Here

    cbList[index].append("<td>");
    cbList[index].append(process.getResourceState());
    cbList[index].append("</td>");
    // Reason:scheduler
    index++; // jp.06
    IDuccProcess jp = process;
    switch(jp.getProcessState()) {
    case Starting:
    case Initializing:
    case Running:
      cbList[index].append("<td>");
      cbList[index].append("</td>");
      break;
    default:
      switch(sType) {
      default:
        ProcessDeallocationType deallocationType = process.getProcessDeallocationType();
        cbList[index].append("<td>");
        switch(deallocationType) {
        case Undefined:
          break;
        default:
          cbList[index].append(process.getProcessDeallocationType());
          break;
        }
        cbList[index].append("</td>");
        break;
      }
      break;
    }
    // State:agent
    index++; // jp.07
    cbList[index].append("<td>");
    cbList[index].append(process.getProcessState());
    cbList[index].append("</td>");
    // Reason:agent
    index++; // jp.08
    cbList[index].append("<td>");
    String agentReason = process.getReasonForStoppingProcess();
    if(agentReason != null) {
      if(agentReason.equalsIgnoreCase(ReasonForStoppingProcess.KilledByDucc.toString())) {
        agentReason = "<div title=\""+ReasonForStoppingProcess.KilledByDucc.toString()+"\">Discontinued</div>";
      }
      else if(agentReason.equalsIgnoreCase(ReasonForStoppingProcess.Other.toString())) {
        agentReason = "<div title=\""+ReasonForStoppingProcess.Other.toString()+"\">Discontinued</div>";
      }
      cbList[index].append(agentReason);
    }
    cbList[index].append("</td>");
    // Exit
    index++; // jp.09
    cbList[index].append("<td>");
    switch(process.getProcessState()) {
    case Stopped:
    case Failed:
    case FailedInitialization:
    case InitializationTimeout:
    case Killed:
      int code = process.getProcessExitCode();
      if(LinuxSignals.isSignal(code)) {
        Signal signal = LinuxSignals.lookup(code);
        if(signal != null) {
          cbList[index].append(signal.name()+"("+signal.number()+")");
        }
        else {
          cbList[index].append("UnknownSignal"+"("+LinuxSignals.getValue(code)+")");
        }
      }
      else {
        cbList[index].append("ExitCode"+"="+code);
      }
      break;
    default:
      break;
    }
    cbList[index].append("</td>")
    // Time:init
    index++; // jp.10
    switch(sType) {
      case MR:
        break;
      default:
        StringBuffer loadme = new StringBuffer();
        String initTime = "00";
        String itd0 = "<td align=\"right\">";
        String itd1 = "</td>";
        String isp0 = "<span>";
        String isp1 = "</span>";
        try {
          TimeWindow t = (TimeWindow) process.getTimeWindowInit();
          if(t != null) {
            long now = System.currentTimeMillis();
            String tS = t.getStart(""+now);
            String tE = t.getEnd(""+now);
            initTime = getDuration(jobid,tE,tS);
            if(t.isEstimated()) {
              isp0 = "<span title=\"estimated\" class=\"health_green\">";
            }
            else {
              isp0 = "<span class=\"health_black\">";
            }
          }
          boolean cluetips_disabled = true;
          if(cluetips_disabled) {
            if(!initTime.equals("00")) {
              String p_idJob = pname_idJob+"="+job.getDuccId().getFriendly();
              String p_idPro = pname_idPro+"="+process.getDuccId().getFriendly();
              initTime = "<a href=\""+duccUimaInitializationReport+"?"+p_idJob+"&"+p_idPro+"\" onclick=\"var newWin = window.open(this.href,'child','height=600,width=475,scrollbars');  newWin.focus(); return false;\">"+initTime+"</a>";
              loadme.append("");
            }
          }
          else {
            List<IUimaPipelineAEComponent> upcList = jp.getUimaPipelineComponents();
            if(upcList != null) {
              if(!upcList.isEmpty()) {
                String id = ""+process.getDuccId().getFriendly();
                initTime = "<a class=\"classLoad\" title=\""+id+"\" href=\"#loadme"+id+"\" rel=\"#loadme"+id+"\">"+initTime+"</a>";
                loadme.append("<div id=\"loadme"+id+"\">");
View Full Code Here

      Iterator<DuccId> iterator = null;
      iterator = job.getDriver().getProcessMap().keySet().iterator();
      int counter = 1;
      while(iterator.hasNext()) {
        DuccId processId = iterator.next();
        IDuccProcess process = job.getDriver().getProcessMap().get(processId);
        StringBuffer bb = new StringBuffer();
        buildJobProcessListEntry(bb, job, process, DetailsType.Job, ShareType.JD, counter);
        if(bb.length() > 0) {
          sb.append(bb.toString());
          counter++;
        }
      }
      iterator = job.getProcessMap().keySet().iterator();
      while(iterator.hasNext()) {
        DuccId processId = iterator.next();
        IDuccProcess process = job.getProcessMap().get(processId);
        StringBuffer bb = new StringBuffer();
        buildJobProcessListEntry(bb, job, process, DetailsType.Job, ShareType.UIMA, counter);
        if(bb.length() > 0) {
          sb.append(bb.toString());
          counter++;
View Full Code Here

          String fid = ""+serviceId.getFriendly();
          if(implementors.contains(fid)) {
            service = (DuccWorkJob) duccWorkMap.findDuccWork(serviceId);
            IDuccProcessMap map = service.getProcessMap();
            for(DuccId key : map.keySet()) {
              IDuccProcess process = map.get(key);
              buildServiceFilesListEntry(baseRequest,request,sb, service, process, type, ++counter);
            }
          }
        }
      }
View Full Code Here

TOP

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

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.