code: public void displayTasks(JobID jobId, String type, String state)
    throws IOException {
      TaskReport[] reports = new TaskReport[0];
      if (type.equals("map")) {
        reports = getMapTaskReports(jobId);
      } else if (type.equals("reduce")) {
        reports = getReduceTaskReports(jobId);
      } else if (type.equals("setup")) {
        reports = getSetupTaskReports(jobId);
      } else if (type.equals("cleanup")) {
        reports = getCleanupTaskReports(jobId);
      }
      for (TaskReport report : reports) {
        TIPStatus status = report.getCurrentStatus();
        if ((state.equals("pending") && status ==TIPStatus.PENDING) ||
            (state.equals("running") && status ==TIPStatus.RUNNING) ||
            (state.equals("completed") && status == TIPStatus.COMPLETE) ||
            (state.equals("failed") && status == TIPStatus.FAILED) ||
            (state.equals("killed") && status == TIPStatus.KILLED)) {
          printTaskAttempts(report);
        }
      }
    }
docs: Display the information about a job's tasks, of a particular type and
  in a particular state
  
  @param jobId the ID of the job
  @param type the type of the task (map/reduce/setup/cleanup)
  @param state the state of the task
  (pending/running/completed/failed/killed)