public void getAttemptsInfo() {
    if (!setupResponse()) {
      return;
    }
    DAG dag = checkAndGetDAGFromRequest();
    if (dag == null) {
      return;
    }
    int limit = MAX_QUERIED;
    try {
      limit = getQueryParamInt(WebUIService.LIMIT);
    } catch (NumberFormatException e) {
      //Ignore
    }
    List<TaskAttempt> attempts = getRequestedAttempts(dag, limit);
    if(attempts == null) {
      return;
    }
    Map<String, Set<String>> counterNames = getCounterListFromRequest();
    ArrayList<Map<String, Object>> attemptsInfo = new ArrayList<Map<String, Object>>();
    for(TaskAttempt a : attempts) {
      Map<String, Object> attemptInfo = new HashMap<String, Object>();
      attemptInfo.put("id", a.getID().toString());
      attemptInfo.put("progress", Float.toString(a.getProgress()));
      attemptInfo.put("status", a.getState().toString());
      try {
        TezCounters counters = a.getCounters();
        Map<String, Map<String, Long>> counterMap = constructCounterMapInfo(counters, counterNames);
        if (counterMap != null && !counterMap.isEmpty()) {
          attemptInfo.put("counters", counterMap);
        }
      } catch (LimitExceededException e) {
        // Ignore
        // TODO: add an error message instead for counter key
      }
      attemptsInfo.add(attemptInfo);
    }
    renderJSON(ImmutableMap.of("attempts", attemptsInfo));
  }
public void getAttemptsInfo() {
    if (!setupResponse()) {
      return;
    }
    DAG dag = checkAndGetDAGFromRequest();
    if (dag == null) {
      return;
    }
    int limit = MAX_QUERIED;
    try {
      limit = getQueryParamInt(WebUIService.LIMIT);
    } catch (NumberFormatException e) {
     
    }
    List<TaskAttempt> attempts = getRequestedAttempts(dag, limit);
    if(attempts == null) {
      return;
    }
    Map<String, Set<String>> counterNames = getCounterListFromRequest();
    ArrayList<Map<String, Object>> attemptsInfo = new ArrayList<Map<String, Object>>();
    for(TaskAttempt a : attempts) {
      Map<String, Object> attemptInfo = new HashMap<String, Object>();
      attemptInfo.put("id", a.getID().toString());
      attemptInfo.put("progress", Float.toString(a.getProgress()));
      attemptInfo.put("status", a.getState().toString());
      try {
        TezCounters counters = a.getCounters();
        Map<String, Map<String, Long>> counterMap = constructCounterMapInfo(counters, counterNames);
        if (counterMap != null && !counterMap.isEmpty()) {
          attemptInfo.put("counters", counterMap);
        }
      } catch (LimitExceededException e) {
       
       
      }
      attemptsInfo.add(attemptInfo);
    }
    renderJSON(ImmutableMap.of("attempts", attemptsInfo));
  }
public void getattemptsinfo() { if (!setupresponse()) { return; } dag dag = checkandgetdagfromrequest(); if (dag == null) { return; } int limit = max_queried; try { limit = getqueryparamint(webuiservice.limit); } catch (numberformatexception e) { } list<taskattempt> attempts = getrequestedattempts(dag, limit); if(attempts == null) { return; } map<string, set<string>> counternames = getcounterlistfromrequest(); arraylist<map<string, object>> attemptsinfo = new arraylist<map<string, object>>(); for(taskattempt a : attempts) { map<string, object> attemptinfo = new hashmap<string, object>(); attemptinfo.put("id", a.getid().tostring()); attemptinfo.put("progress", float.tostring(a.getprogress())); attemptinfo.put("status", a.getstate().tostring()); try { tezcounters counters = a.getcounters(); map<string, map<string, long>> countermap = constructcountermapinfo(counters, counternames); if (countermap != null && !countermap.isempty()) { attemptinfo.put("counters", countermap); } } catch (limitexceededexception e) { } attemptsinfo.add(attemptinfo); } renderjson(immutablemap.of("attempts", attemptsinfo)); }