code: public int countReduceTasks() {
      int reduceCount = 0;
      for (Iterator<TaskStatus> it = taskReports.iterator(); it.hasNext();) {
        TaskStatus ts = (TaskStatus) it.next();
        if ((!ts.getIsMap()) && isTaskRunning(ts)) {
          reduceCount++;
        }
      }
      return reduceCount;
    }
docs: Get the number of running reduce tasks.
  @return the number of running reduce tasks