private Map<String, Object> getVertexInfoMap(Vertex vertex,
                                               Map<String, Set<String>> counterNames) {
    Map<String, Object> vertexInfo = new HashMap<String, Object>();
    vertexInfo.put("id", vertex.getVertexId().toString());
    vertexInfo.put("status", vertex.getState().toString());
    vertexInfo.put("progress", Float.toString(vertex.getCompletedTaskProgress()));
    vertexInfo.put("initTime", Long.toString(vertex.getInitTime()));
    vertexInfo.put("startTime", Long.toString(vertex.getStartTime()));
    vertexInfo.put("finishTime", Long.toString(vertex.getFinishTime()));
    vertexInfo.put("firstTaskStartTime", Long.toString(vertex.getFirstTaskStartTime()));
    vertexInfo.put("lastTaskFinishTime", Long.toString(vertex.getLastTaskFinishTime()));
    ProgressBuilder vertexProgress = vertex.getVertexProgress();
    vertexInfo.put("totalTasks", Integer.toString(vertexProgress.getTotalTaskCount()));
    vertexInfo.put("runningTasks", Integer.toString(vertexProgress.getRunningTaskCount()));
    vertexInfo.put("succeededTasks", Integer.toString(vertexProgress.getSucceededTaskCount()));
    vertexInfo.put("failedTaskAttempts",
        Integer.toString(vertexProgress.getFailedTaskAttemptCount()));
    vertexInfo.put("killedTaskAttempts",
        Integer.toString(vertexProgress.getKilledTaskAttemptCount()));
    try {
      if (counterNames != null && !counterNames.isEmpty()) {
        TezCounters counters = vertex.getCachedCounters();
        Map<String, Map<String, Long>> counterMap = constructCounterMapInfo(counters, counterNames);
        if (counterMap != null && !counterMap.isEmpty()) {
          vertexInfo.put("counters", counterMap);
        }
      }
    } catch (LimitExceededException e) {
      // Ignore
      // TODO: add an error message instead for counter key
    }
    return vertexInfo;
  }
private Map<String, Object> getVertexInfoMap(Vertex vertex,
                                               Map<String, Set<String>> counterNames) {
    Map<String, Object> vertexInfo = new HashMap<String, Object>();
    vertexInfo.put("id", vertex.getVertexId().toString());
    vertexInfo.put("status", vertex.getState().toString());
    vertexInfo.put("progress", Float.toString(vertex.getCompletedTaskProgress()));
    vertexInfo.put("initTime", Long.toString(vertex.getInitTime()));
    vertexInfo.put("startTime", Long.toString(vertex.getStartTime()));
    vertexInfo.put("finishTime", Long.toString(vertex.getFinishTime()));
    vertexInfo.put("firstTaskStartTime", Long.toString(vertex.getFirstTaskStartTime()));
    vertexInfo.put("lastTaskFinishTime", Long.toString(vertex.getLastTaskFinishTime()));
    ProgressBuilder vertexProgress = vertex.getVertexProgress();
    vertexInfo.put("totalTasks", Integer.toString(vertexProgress.getTotalTaskCount()));
    vertexInfo.put("runningTasks", Integer.toString(vertexProgress.getRunningTaskCount()));
    vertexInfo.put("succeededTasks", Integer.toString(vertexProgress.getSucceededTaskCount()));
    vertexInfo.put("failedTaskAttempts",
        Integer.toString(vertexProgress.getFailedTaskAttemptCount()));
    vertexInfo.put("killedTaskAttempts",
        Integer.toString(vertexProgress.getKilledTaskAttemptCount()));
    try {
      if (counterNames != null && !counterNames.isEmpty()) {
        TezCounters counters = vertex.getCachedCounters();
        Map<String, Map<String, Long>> counterMap = constructCounterMapInfo(counters, counterNames);
        if (counterMap != null && !counterMap.isEmpty()) {
          vertexInfo.put("counters", counterMap);
        }
      }
    } catch (LimitExceededException e) {
     
     
    }
    return vertexInfo;
  }
private map<string, object> getvertexinfomap(vertex vertex, map<string, set<string>> counternames) { map<string, object> vertexinfo = new hashmap<string, object>(); vertexinfo.put("id", vertex.getvertexid().tostring()); vertexinfo.put("status", vertex.getstate().tostring()); vertexinfo.put("progress", float.tostring(vertex.getcompletedtaskprogress())); vertexinfo.put("inittime", long.tostring(vertex.getinittime())); vertexinfo.put("starttime", long.tostring(vertex.getstarttime())); vertexinfo.put("finishtime", long.tostring(vertex.getfinishtime())); vertexinfo.put("firsttaskstarttime", long.tostring(vertex.getfirsttaskstarttime())); vertexinfo.put("lasttaskfinishtime", long.tostring(vertex.getlasttaskfinishtime())); progressbuilder vertexprogress = vertex.getvertexprogress(); vertexinfo.put("totaltasks", integer.tostring(vertexprogress.gettotaltaskcount())); vertexinfo.put("runningtasks", integer.tostring(vertexprogress.getrunningtaskcount())); vertexinfo.put("succeededtasks", integer.tostring(vertexprogress.getsucceededtaskcount())); vertexinfo.put("failedtaskattempts", integer.tostring(vertexprogress.getfailedtaskattemptcount())); vertexinfo.put("killedtaskattempts", integer.tostring(vertexprogress.getkilledtaskattemptcount())); try { if (counternames != null && !counternames.isempty()) { tezcounters counters = vertex.getcachedcounters(); map<string, map<string, long>> countermap = constructcountermapinfo(counters, counternames); if (countermap != null && !countermap.isempty()) { vertexinfo.put("counters", countermap); } } } catch (limitexceededexception e) { } return vertexinfo; }