code: synchronized List<TaskTrackerAction> getTasksToSave(
                                                   TaskTrackerStatus tts) {
      List<TaskStatus> taskStatuses = tts.getTaskReports();
      if (taskStatuses != null) {
        List<TaskTrackerAction> saveList = new ArrayList<TaskTrackerAction>();
        for (TaskStatus taskStatus : taskStatuses) {
          if (taskStatus.getRunState() == TaskStatus.State.COMMIT_PENDING) {
            TaskAttemptID taskId = taskStatus.getTaskID();
            TaskInProgress tip = taskidToTIPMap.get(taskId);
            if (tip == null) {
              continue;
            }
            if (tip.shouldCommit(taskId)) {
              saveList.add(new CommitTaskAction(taskId));
              LOG.info(tts.getTrackerName() +
                        " -> CommitTaskAction: " + taskId);
            }
          }
        }
        return saveList;
      }
      return null;
    }
docs: A tracker wants to know if any of its Tasks can be committed