public String getTaskNumbers() {
    StringBuilder sb = new StringBuilder();
    if (numMap > 0) {
      sb.append("Map: " + numMap + "  ");
    }
    if (numReduce > 0) {
      sb.append("Reduce: " + numReduce + "  ");
    }
    return sb.toString();
  }
MapRedStats.

A data structure to keep one mapreduce's stats:
number of mappers, number of reducers, accumulative CPU time and whether it
succeeds.
ql/src/java/org/apache/hadoop/hive/ql/MapRedStats.java