public void getTasksInfo() {
    if (!setupResponse()) {
      return;
    }
    DAG dag = checkAndGetDAGFromRequest();
    if (dag == null) {
      return;
    }
    int limit = MAX_QUERIED;
    try {
      limit = getQueryParamInt(WebUIService.LIMIT);
    } catch (NumberFormatException e) {
      //Ignore
    }
    List<Task> tasks = getRequestedTasks(dag, limit);
    if(tasks == null) {
      return;
    }
    Map<String, Set<String>> counterNames = getCounterListFromRequest();
    ArrayList<Map<String, Object>> tasksInfo = new ArrayList<Map<String, Object>>();
    for(Task t : tasks) {
      Map<String, Object> taskInfo = new HashMap<String, Object>();
      taskInfo.put("id", t.getTaskId().toString());
      taskInfo.put("progress", Float.toString(t.getProgress()));
      taskInfo.put("status", t.getState().toString());
      try {
        TezCounters counters = t.getCounters();
        Map<String, Map<String, Long>> counterMap = constructCounterMapInfo(counters, counterNames);
        if (counterMap != null && !counterMap.isEmpty()) {
          taskInfo.put("counters", counterMap);
        }
      } catch (LimitExceededException e) {
        // Ignore
        // TODO: add an error message instead for counter key
      }
      tasksInfo.add(taskInfo);
    }
    renderJSON(ImmutableMap.of(
      "tasks", tasksInfo
    ));
  }
public void getTasksInfo() {
    if (!setupResponse()) {
      return;
    }
    DAG dag = checkAndGetDAGFromRequest();
    if (dag == null) {
      return;
    }
    int limit = MAX_QUERIED;
    try {
      limit = getQueryParamInt(WebUIService.LIMIT);
    } catch (NumberFormatException e) {
     
    }
    List<Task> tasks = getRequestedTasks(dag, limit);
    if(tasks == null) {
      return;
    }
    Map<String, Set<String>> counterNames = getCounterListFromRequest();
    ArrayList<Map<String, Object>> tasksInfo = new ArrayList<Map<String, Object>>();
    for(Task t : tasks) {
      Map<String, Object> taskInfo = new HashMap<String, Object>();
      taskInfo.put("id", t.getTaskId().toString());
      taskInfo.put("progress", Float.toString(t.getProgress()));
      taskInfo.put("status", t.getState().toString());
      try {
        TezCounters counters = t.getCounters();
        Map<String, Map<String, Long>> counterMap = constructCounterMapInfo(counters, counterNames);
        if (counterMap != null && !counterMap.isEmpty()) {
          taskInfo.put("counters", counterMap);
        }
      } catch (LimitExceededException e) {
       
       
      }
      tasksInfo.add(taskInfo);
    }
    renderJSON(ImmutableMap.of(
      "tasks", tasksInfo
    ));
  }
public void gettasksinfo() { if (!setupresponse()) { return; } dag dag = checkandgetdagfromrequest(); if (dag == null) { return; } int limit = max_queried; try { limit = getqueryparamint(webuiservice.limit); } catch (numberformatexception e) { } list<task> tasks = getrequestedtasks(dag, limit); if(tasks == null) { return; } map<string, set<string>> counternames = getcounterlistfromrequest(); arraylist<map<string, object>> tasksinfo = new arraylist<map<string, object>>(); for(task t : tasks) { map<string, object> taskinfo = new hashmap<string, object>(); taskinfo.put("id", t.gettaskid().tostring()); taskinfo.put("progress", float.tostring(t.getprogress())); taskinfo.put("status", t.getstate().tostring()); try { tezcounters counters = t.getcounters(); map<string, map<string, long>> countermap = constructcountermapinfo(counters, counternames); if (countermap != null && !countermap.isempty()) { taskinfo.put("counters", countermap); } } catch (limitexceededexception e) { } tasksinfo.add(taskinfo); } renderjson(immutablemap.of( "tasks", tasksinfo )); }