Package org.apache.uima.ducc.ws

Examples of org.apache.uima.ducc.ws.DuccMachinesData


          else {
            ConcurrentSkipListMap<IWorkItemState,IWorkItemState> sortedMap = new ConcurrentSkipListMap<IWorkItemState,IWorkItemState>();
          for (Entry<Long, IWorkItemState> entry : map.entrySet()) {
            sortedMap.put(entry.getValue(), entry.getValue());
          }
          DuccMachinesData machinesData = DuccMachinesData.getInstance();
            DecimalFormat formatter = new DecimalFormat("##0.00");
          double time;
          int counter = 0;
            for (Entry<IWorkItemState, IWorkItemState> entry : sortedMap.entrySet()) {
              StringBuffer row = new StringBuffer();
              IWorkItemState wis = entry.getValue();
              row.append(trGet(counter++));
              if(counter > DuccConstants.workItemsDisplayMax) {
                // SeqNo
              row.append("<td align=\"right\">");
              row.append("*****");
              // Id
              row.append("<td align=\"right\">");
              row.append("*****");
              // Status
              row.append("<td align=\"right\">");
              row.append("display");
              // Queuing Time (sec)
              row.append("<td align=\"right\">");
              row.append("limit");
              // Processing Time (sec)
              row.append("<td align=\"right\">");
              row.append("reached");
              // Node (IP)
              row.append("<td align=\"right\">");
              row.append("*****");
              // Node (Name)
              row.append("<td align=\"right\">");
              row.append("*****");
              // PID
              row.append("<td align=\"right\">");
              row.append("*****");
              sb.append(row);
                duccLogger.warn(methodName, job.getDuccId(), "work items display max:"+DuccConstants.workItemsDisplayMax);
                break;
              }
              // SeqNo
            row.append("<td align=\"right\">");
            row.append(wis.getSeqNo());
            // Id
            row.append("<td align=\"right\">");
            row.append(wis.getWiId());
            // Status
            row.append("<td align=\"right\">");
           
            State state = wis.getState();
            StringBuffer status = new StringBuffer();
            switch(state) {
            case lost:
              //status = row.append("<span title=\"Work Item was queued but never dequeued. (This is most likely a DUCC framework issue.)\" >");
              status.append("<span title=\"Work Item was queued but never dequeued.\" >");
              status.append(state);
              status.append("</span>");
              break;
            default:
              status.append(state);
              break;
            }
            row.append(status);
            // Queuing Time (sec)
            time = getAdjustedTime(wis.getMillisOverhead(), job);
            time = time/1000;
            row.append("<td align=\"right\">");
            row.append(formatter.format(time));
            // Processing Time (sec)
            time = getAdjustedTime(wis.getMillisProcessing(), job);
            time = time/1000;
            row.append("<td align=\"right\">");
            switch(state) {
            case start:
            case queued:
            case operating:
              row.append("<span title=\"estimated\" class=\"health_green\">");
              break;
            default:
              row.append("<span class=\"health_black\">");
              break;
            }
            row.append(formatter.format(time));
            row.append("</span>");
            // Node (IP)
            row.append("<td>");
            String node = wis.getNode();
            if(node != null) {
              row.append(node);
            }
            // Node (Name)
            row.append("<td>");
            if(node != null) {
              String hostName = machinesData.getNameForIp(node);
              if(hostName != null) {
                row.append(hostName);
              }
            }
            // PID
View Full Code Here


    String methodName = "handleJsonServletMachinesData";
    duccLogger.trace(methodName, null, messages.fetch("enter"));
    StringBuffer sb = new StringBuffer();
    sb.append("{ ");
    sb.append("\"aaData\": [ ");
    DuccMachinesData instance = DuccMachinesData.getInstance();
    ConcurrentSkipListMap<MachineInfo,String> sortedMachines = instance.getSortedMachines();
    Iterator<MachineInfo> iterator;
    // pass 1
    iterator = sortedMachines.keySet().iterator();
    long memTotal = 0;
    long memSwap = 0;
View Full Code Here

          qualify = true;
        }
      }
      ArrayList<String> qualifiedPids = new ArrayList<String>();
      if(duccwork.isOperational()) {
        DuccMachinesData machinesData = DuccMachinesData.getInstance();
        for (String node: nodeMap.keySet()) {
          NodeId nodeId = new NodeId(node);
          List<String> nodePids = machinesData.getPids(nodeId, userId);
          for( String pid : nodePids ) {
            if(qualify) {
              qualifiedPids.add(node+":"+pid);
            }
            else {
View Full Code Here

   
    ListIterator<MachineFacts> listIterator;
    JsonArray row;
    StringBuffer sb;
   
    DuccMachinesData instance = DuccMachinesData.getInstance();
   
    MachineFactsList factsList = instance.getMachineFactsList();
    if(factsList.size() > 0) {
      // Total
      listIterator = factsList.listIterator();
      while(listIterator.hasNext()) {
        MachineFacts facts = listIterator.next();
View Full Code Here

  {
    String methodName = "handleServletJsonFormatMachines";
    duccLogger.trace(methodName, jobid, messages.fetch("enter"));
    StringBuffer sb = new StringBuffer();
   
    DuccMachinesData instance = DuccMachinesData.getInstance();
   
    MachineFactsList factsList = instance.getMachineFactsList();
   
    Gson gson = new Gson();
    String jSon = gson.toJson(factsList);
    sb.append(jSon);
    duccLogger.debug(methodName, jobid, sb);
View Full Code Here

          qualify = true;
        }
      }
      ArrayList<String> qualifiedPids = new ArrayList<String>();
      if(duccwork.isOperational()) {
        DuccMachinesData machinesData = DuccMachinesData.getInstance();
        for (String node: nodeMap.keySet()) {
          NodeId nodeId = new NodeId(node);
          List<String> nodePids = machinesData.getPids(nodeId, userId);
          for( String pid : nodePids ) {
            if(qualify) {
              qualifiedPids.add(node+":"+pid);
            }
            else {
View Full Code Here

   
    ListIterator<MachineFacts> listIterator;
    StringBuffer row;
    StringBuffer data = new StringBuffer();
   
    DuccMachinesData instance = DuccMachinesData.getInstance();
   
    MachineFactsList factsList = instance.getMachineFactsList();
    if(factsList.size() > 0) {
      // Total
      listIterator = factsList.listIterator();
      while(listIterator.hasNext()) {
        MachineFacts facts = listIterator.next();
View Full Code Here

TOP

Related Classes of org.apache.uima.ducc.ws.DuccMachinesData

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.