code: public Task getTaskToRun(String taskTracker) {
  
      // Create the 'taskid'; do not count the 'killed' tasks against the job!
      TaskAttemptID taskid = null;
      if (nextTaskId < (MAX_TASK_EXECS + maxTaskAttempts + numKilledTasks)) {
        // Make sure that the attempts are unqiue across restarts
        int attemptId = job.getNumRestarts() * NUM_ATTEMPTS_PER_RESTART + nextTaskId;
        taskid = new TaskAttemptID( id, attemptId);
        ++nextTaskId;
      } else {
        LOG.warn("Exceeded limit of " + (MAX_TASK_EXECS + maxTaskAttempts) +
                " (plus " + numKilledTasks + " killed)"  + 
                " attempts for the tip '" + getTIPId() + "'");
        return null;
      }
      //keep track of the last time we started an attempt at this TIP
      //used to calculate the progress rate of this TIP
      setDispatchTime(taskid, JobTracker.getClock().getTime());
      if (0 == execStartTime){
        // assume task starts running now
        execStartTime = JobTracker.getClock().getTime();
      }
      return addRunningTask(taskid, taskTracker);
    }
docs: Return a Task that can be sent to a TaskTracker for execution.