code: public Task obtainJobCleanupTask(
        String taskTrackerName, String hostName, boolean isMapSlot) {
      synchronized (lockObject) {
        if(!tasksInited || !jobSetupCleanupNeeded) {
          return null;
        }
  
        if (!canLaunchJobCleanupTaskUnprotected()) {
          return null;
        }
  
        List<TaskInProgress> cleanupTaskList = new ArrayList<TaskInProgress>();
        if (isMapSlot) {
          cleanupTaskList.add(cleanup[0]);
        } else {
          cleanupTaskList.add(cleanup[1]);
        }
        TaskInProgress tip =
          findTaskFromList(cleanupTaskList, hostName, false);
        if (tip == null) {
          return null;
        }
  
        // Now launch the cleanupTask
        Task result = tip.getTaskToRun(taskTrackerName);
  
        if (result != null) {
          addRunningTaskToTIPUnprotected(tip, result.getTaskID(), taskTrackerName, hostName,
              true);
          // Handle cleanup task
          setJobCleanupTaskState(result);
        }
        return result;
      }
    }
docs: Return a CleanupTask, if appropriate, to run on the given tasktracker