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

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


       
    ProcessBuilder pb = new ProcessBuilder(cmd);
   
    if ( ((ManagedProcess)super.managedProcess).getDuccProcess().getProcessType().equals(ProcessType.Pop) ||
        ((ManagedProcess)super.managedProcess).getDuccProcess().getProcessType().equals(ProcessType.Service)   ) {
      ITimeWindow twi = new TimeWindow();
      ((ManagedProcess) managedProcess).getDuccProcess().setTimeWindowInit(twi);
      twi.setStart(millis);
      twi.setEnd(millis);

      ITimeWindow twr = new TimeWindow();
      ((ManagedProcess) managedProcess).getDuccProcess().setTimeWindowRun(twr);
      twr.setStart(millis);

    }
 
    Map<String, String> env = pb.environment();
    //  Dont enherit agent's environment
View Full Code Here


        return init_time.getElapsedMillis();       
    }

    public void setInitializationTime(long millis)
    {
        init_time = new TimeWindow();
        init_time.setStartLong(0);
        init_time.setEndLong(millis);
    }
View Full Code Here

    }
    logger.trace(methodName, job.getDuccId(), messages.fetch("exit"));
  }
 
  private ITimeWindow makeTimeWindow(String ts) {
    ITimeWindow tw = new TimeWindow();
    tw.setStart(ts);
    tw.setEnd(ts);
    return tw;
  }
View Full Code Here

  // <uima-3351>
  private void adjustRunTime(IDuccProcess process) {
    if(!process.isAssignedWork()) {
      ITimeWindow twr = process.getTimeWindowRun();
      if(twr == null) {
        twr = new TimeWindow();
        process.setTimeWindowRun(twr);
      }
      long time = 0;
      twr.setStartLong(time);
      twr.setEndLong(time);
View Full Code Here

            // Mark the time the process ended initialization. It also
            // covers a case when the process terminates while initializing
                tw.setEnd(TimeStamp.getCurrentMillis());
           
              if ( duccEvent.getState().equals(ProcessState.Running)) {
                ITimeWindow twr = new TimeWindow();
                String millis;
                millis = TimeStamp.getCurrentMillis();
                // Mark the time the process started running
                processEntry.getValue().setTimeWindowRun(twr);
                twr.setStart(millis);
              }
          }
          }
          ManagedProcess deployedProcess = null;
          synchronized (monitor) {
View Full Code Here

          logger.info(methodName, workDuccId, "Agent [" + getIdentity().getIp()
                  + "] Deploying Process - DuccID:" + process.getDuccId().getFriendly()
                  + " Unique DuccID:" + process.getDuccId().getUnique() + " Node Assignment:"
                  + process.getNodeIdentity().getIp() + " Process Memory Assignment:"
                  + processMemoryAssignment + " MBs");
          TimeWindow tw = new TimeWindow();
          tw.setStart(TimeStamp.getCurrentMillis());
          tw.setEnd(null);
          process.setTimeWindowInit(tw);
          ManagedProcess managedProcess = new ManagedProcess(process, commandLine, this, logger,
                  processMemoryAssignment);
          managedProcess.setProcessInfo(info);
          managedProcess.setWorkDuccId(workDuccId);
View Full Code Here

        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+"\">");
                loadme.append("<table>");
                loadme.append("<tr>");
                String ch1 = "Name";
                String ch2 = "State";
                String ch3 = "Time";
                loadme.append("<td>"+"<b>"+ch1+"</b>");
                loadme.append("<td>"+"<b>"+ch2+"</b>");
                loadme.append("<td>"+"<b>"+ch3+"</b>");
                Iterator<IUimaPipelineAEComponent> upcIterator = upcList.iterator();
                while(upcIterator.hasNext()) {
                  IUimaPipelineAEComponent upc = upcIterator.next();
                  String iName = upc.getAeName();
                  String iState = upc.getAeState().toString();
                  String iTime = FormatHelper.duration(upc.getInitializationTime());
                  loadme.append("<tr>");
                  loadme.append("<td>"+iName);
                  loadme.append("<td>"+iState);
                  loadme.append("<td>"+iTime);
                }
                loadme.append("</table>");
                loadme.append("</div>");
              }
            }
          }
        }
        catch(Exception e) {
          duccLogger.trace(location, jobid, "no worries", e);
        }
        catch(Throwable t) {
          duccLogger.trace(location, jobid, "no worries", t);
        }
        cbList[index].append(itd0);
        cbList[index].append(isp0);
        cbList[index].append(loadme);
        cbList[index].append(initTime);
        cbList[index].append(isp1);
        cbList[index].append(itd1);       
        break;
    }
    // Time:run
    index++; // jp.11
    String runTime = "00";
    String rtd0 = "<td align=\"right\">";
    String rtd1 = "</td>";
    String rsp0 = "<span>";
    String rsp1 = "</span>";
    // <UIMA-3351>
    boolean useTimeRun = true;
    switch(sType) {
    case SPC:
      break;
    case SPU:
      break;
    case MR:
      break;
    case JD:
      break
    case UIMA:
      if(!process.isAssignedWork()) {
        useTimeRun = false;
      }
      break
    default:
      break;
    }
    // </UIMA-3351>
    if(useTimeRun) {
      try {
        TimeWindow t = (TimeWindow) process.getTimeWindowRun();
        if(t != null) {
          long now = System.currentTimeMillis();
          String tS = t.getStart(""+now);
          String tE = t.getEnd(""+now);
          runTime = getDuration(jobid,tE,tS);
          if(t.isEstimated()) {
            rsp0 = "<span title=\"estimated\" class=\"health_green\">";
          }
          else {
            rsp0 = "<span class=\"health_black\">";
          }
View Full Code Here

TOP

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

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.