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