// Ignore
// TODO: add an error message instead for counter key
public void getDagInfo() {
    if (!setupResponse()) {
      return;
    }
    DAG dag = checkAndGetDAGFromRequest();
    if (dag == null) {
      return;
    }
    Map<String, Set<String>> counterNames = getCounterListFromRequest();
    Map<String, Object> dagInfo = new HashMap<String, Object>();
    dagInfo.put("id", dag.getID().toString());
    dagInfo.put("progress", Float.toString(dag.getCompletedTaskProgress()));
    dagInfo.put("status", dag.getState().toString());
    try {
      if (counterNames != null && !counterNames.isEmpty()) {
        TezCounters counters = dag.getCachedCounters();
        Map<String, Map<String, Long>> counterMap = constructCounterMapInfo(counters, counterNames);
        if (counterMap != null && !counterMap.isEmpty()) {
          dagInfo.put("counters", counterMap);
        }
      }
    } catch (LimitExceededException e) {
      // Ignore
      // TODO: add an error message instead for counter key
    }
    renderJSON(ImmutableMap.of(
        "dag", dagInfo
    ));
  }
}
} catch (LimitExceededException e) {
// Ignore
// TODO: add an error message instead for counter key
}
renderJSON(ImmutableMap.of(
dagInfo.put("status", dag.getState().toString());
try {
if (counterNames != null && !counterNames.isEmpty()) {
TezCounters counters = dag.getCachedCounters();
Map<String, Map<String, Long>> counterMap = constructCounterMapInfo(counters, counterNames);
if (counterMap != null && !counterMap.isEmpty()) {
dagInfo.put("counters", counterMap);
}
}
} catch (LimitExceededException e) {
// Ignore
// TODO: add an error message instead for counter key
}
renderJSON(ImmutableMap.of(
"dag", dagInfo
));
}
return;
}
DAG dag = checkAndGetDAGFromRequest();
if (dag == null) {
return;
}
Map<String, Set<String>> counterNames = getCounterListFromRequest();
Map<String, Object> dagInfo = new HashMap<String, Object>();
dagInfo.put("id", dag.getID().toString());
dagInfo.put("progress", Float.toString(dag.getCompletedTaskProgress()));
dagInfo.put("status", dag.getState().toString());
try {
if (counterNames != null && !counterNames.isEmpty()) {
TezCounters counters = dag.getCachedCounters();
Map<String, Map<String, Long>> counterMap = constructCounterMapInfo(counters, counterNames);
if (counterMap != null && !counterMap.isEmpty()) {
dagInfo.put("counters", counterMap);
}
}
} catch (LimitExceededException e) {
// Ignore
// TODO: add an error message instead for counter key
}
renderJSON(ImmutableMap.of(
"dag", dagInfo
));
}