code: private List<SimulatorEvent> handleAllMapsCompletedTaskAction(
                          AllMapsCompletedTaskAction action, long now) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("Handling all maps completed task action " + action);
      }
      
      TaskAttemptID taskId = action.getTaskID();
      SimulatorTaskInProgress tip = tasks.get(taskId);
      // If tip is null here it is because the task attempt to be notified is
      // unknown to this TaskTracker.
      TaskStatus status = tip.getTaskStatus();
      if (status.getIsMap()) {
        throw new IllegalStateException(
            "Invalid AllMapsCompletedTaskAction, task attempt "
                + "to be notified is a map: " + taskId + " " + status);
      }
      if (status.getPhase() != Phase.SHUFFLE) {
        throw new IllegalArgumentException(
            "Reducer task attempt already notified: " + taskId + " " + status);
      }
             
      // Warning: setPhase() uses System.currentTimeMillis() internally to
      // set shuffle and sort times, but we overwrite that manually anyway
      status.setPhase(Phase.REDUCE);
      status.setShuffleFinishTime(now);
      status.setSortFinishTime(now);
      
      // Forecast the completion of this reduce
      TaskAttemptCompletionEvent e = createTaskAttemptCompletionEvent(tip, now);
      return Collections.<SimulatorEvent>singletonList(e);
    }
docs: Starts "running" the REDUCE phase of reduce upon being notified that
  all map tasks are (successfully) done.
  
  @param action contains the notification for one of the reduce tasks
  @param now current simulation time
  @return new events generated, a single TaskAttemptCompletionEvent for the
  reduce