Exemplo n.º 1
0
  private void incrementCounts(
      Map<String, TaskStats> counts,
      String countsKey,
      String flowName,
      String stepName,
      int mapCount,
      int reduceCount,
      long mapTime,
      long reduceTime) {
    // If they're all zero, just ignore the call so we don't get extra entries.
    if ((mapCount == 0) && (reduceCount == 0) && (mapTime == 0) && (reduceTime == 0)) {
      return;
    }

    TaskStats curStats = counts.get(countsKey);
    if (curStats == null) {
      curStats = new TaskStats(flowName, stepName);
    }

    curStats.incMapCount(mapCount);
    curStats.incReduceCount(reduceCount);
    curStats.incMapTime(mapTime);
    curStats.incReduceTime(reduceTime);

    counts.put(countsKey, curStats);
  }