code: private void setJobCleanupTaskState(Task task) {
      if (task.isJobCleanupTask()) {
        if (jobFailed) {
          task.setJobCleanupTaskState(
              org.apache.hadoop.mapreduce.JobStatus.State.FAILED);
        } else if (jobKilled) {
          task.setJobCleanupTaskState(
              org.apache.hadoop.mapreduce.JobStatus.State.KILLED);
        } else {
          task.setJobCleanupTaskState(
              org.apache.hadoop.mapreduce.JobStatus.State.SUCCEEDED);
        }
      }
    }
docs: Sets task state according to job state if given task is cleanup one
  @param task task to handle