Package org.apache.uima.ducc.common.json

Examples of org.apache.uima.ducc.common.json.MonitorInfo


    while( iterator.hasNext() ) {
      DuccId duccId = iterator.next();
      IDuccWork dw = (IDuccWork)dwm.findDuccWork(duccId);
      gone.remove(duccId);
      if(!mMap.containsKey(duccId)) {
        MonitorInfo monitorInfo = new MonitorInfo();
        mMap.put(duccId, monitorInfo);
        duccLogger.info(location, duccId, "monitor start");
        if(!tMap.containsKey(duccId)) {
          if(dw.isCancelOnInterrupt()) {
            TrackingInfo ti = new TrackingInfo();
            ti.time = expiryMillis;
            ti.user = dw.getStandardInfo().getUser();
            tMap.put(duccId,ti);
            duccLogger.info(location, duccId, "auto-cancel on");
          }
          else {
            duccLogger.info(location, duccId, "auto-cancel off");
          }
        }
      }
      DuccWorkJob dwj = (DuccWorkJob) dw;
      MonitorInfo monitorInfo = mMap.get(duccId);
      IDuccSchedulingInfo si = dw.getSchedulingInfo();
      monitorInfo.total = si.getWorkItemsTotal();
      monitorInfo.done  = si.getWorkItemsCompleted();
      monitorInfo.error = ""+si.getIntWorkItemsError();
      monitorInfo.retry = si.getWorkItemsRetry();
View Full Code Here


      String message = "id invalid";
      duccLogger.info(location, jobid, message);
      response.sendError(HttpServletResponse.SC_BAD_REQUEST, message);
    }
    else {
      MonitorInfo monitorInfo  = duccWebMonitor.renew(DuccType.Job, jobId);
      Gson gson = new Gson();
      String jSon = gson.toJson(monitorInfo);
      duccLogger.debug(location, jobid, jSon);
      response.getWriter().println(jSon);
      response.setContentType("application/json");
View Full Code Here

      String message = "id invalid";
      duccLogger.info(location, jobid, message);
      response.sendError(HttpServletResponse.SC_BAD_REQUEST, message);
    }
    else {
      MonitorInfo monitorInfo  = duccWebMonitor.renew(DuccType.Reservation, id);
      Gson gson = new Gson();
      String jSon = gson.toJson(monitorInfo);
      duccLogger.debug(location, jobid, jSon);
      response.getWriter().println(jSon);
      response.setContentType("application/json");
View Full Code Here

    return true;
  }

 
  public MonitorInfo renew(DuccType duccType, String id) {
    MonitorInfo monitorInfo = new MonitorInfo();
    if(duccType != null) {
      if(id != null) {
        switch(duccType) {
        case Job:
          monitorInfo = duccWebMonitorJob.renew(id, updateCounter);
View Full Code Here

    while( iterator.hasNext() ) {
      DuccId duccId = iterator.next();
      IDuccWork dw = (IDuccWork)dwm.findDuccWork(duccId);
      gone.remove(duccId);
      if(!mMap.containsKey(duccId)) {
        MonitorInfo monitorInfo = new MonitorInfo();
        mMap.put(duccId, monitorInfo);
        duccLogger.info(location, duccId, "monitor start");
        if(!tMap.containsKey(duccId)) {
          if(dw.isCancelOnInterrupt()) {
            TrackingInfo ti = new TrackingInfo();
            ti.time = expiryMillis;
            ti.user = dw.getStandardInfo().getUser();
            tMap.put(duccId,ti);
            duccLogger.info(location, duccId, "auto-cancel on");
          }
          else {
            duccLogger.info(location, duccId, "auto-cancel off");
          }
        }
      }
      DuccWorkJob dwr = (DuccWorkJob) dw;
      MonitorInfo monitorInfo = mMap.get(duccId);
      //IDuccSchedulingInfo si = dwr.getSchedulingInfo();
      //monitorInfo.total = si.getWorkItemsTotal();    // ignore for MR, default to 0
      //monitorInfo.done  = si.getWorkItemsCompleted();  // ignore for MR, default to 0
      //monitorInfo.error = si.getWorkItemsError();    // ignore for MR, default to 0
      //monitorInfo.retry = si.getWorkItemsRetry();    // ignore for MR, default to 0
View Full Code Here

 
  public MonitorInfo renew(String jobId, AtomicInteger updateCounter) {
    String location = "renew";
    duccLogger.trace(location, jobid, "enter");
   
    MonitorInfo monitorInfo = new MonitorInfo();
   
    int countAtArrival = updateCounter.get();
    int countAtPresent = countAtArrival;
    int sleepSecondsMax = 3*60;
   
 
View Full Code Here

  private boolean isCancelable(DuccId duccId) {
    String location = "isCancelable";
    duccLogger.trace(location, duccId, "enter");
    boolean retVal = false;
    if(!cMap.containsKey(duccId)) {
      MonitorInfo monitorInfo = mMap.get(duccId);
      if(monitorInfo != null) {
        ArrayList<String> stateSequence = monitorInfo.stateSequence;
        if(stateSequence != null) {
          if(stateSequence.contains(JobState.Completing.toString())) {
            duccLogger.debug(location, duccId, "state: <uncancelable> "+stateSequence);
View Full Code Here

 
  public MonitorInfo renew(String jobId, AtomicInteger updateCounter) {
    String location = "renew";
    duccLogger.trace(location, jobid, "enter");
   
    MonitorInfo monitorInfo = new MonitorInfo();
   
    int countAtArrival = updateCounter.get();
    int countAtPresent = countAtArrival;
    int sleepSecondsMax = 3*60;
   
 
View Full Code Here

  private boolean isCancelable(DuccId duccId) {
    String location = "isCancelable";
    duccLogger.trace(location, duccId, "enter");
    boolean retVal = false;
    if(!cMap.containsKey(duccId)) {
      MonitorInfo monitorInfo = mMap.get(duccId);
      if(monitorInfo != null) {
        ArrayList<String> stateSequence = monitorInfo.stateSequence;
        if(stateSequence != null) {
          if(stateSequence.contains(JobState.Completing.toString())) {
            duccLogger.debug(location, duccId, "state: <uncancelable> "+stateSequence);
View Full Code Here

    while (flag_observer.get()) {
      String json = getSingleLineStatus(urlString);
      if (json != null) {
        debug(json);
        Gson gson = new Gson();
        MonitorInfo monitorInfo = gson
            .fromJson(json, MonitorInfo.class);
        int stateCount = monitorInfo.stateSequence.size();
        debug("states:" + stateCount);
        if (stateCount <= 0) {
          message = new StringBuffer();
View Full Code Here

TOP

Related Classes of org.apache.uima.ducc.common.json.MonitorInfo

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.