/** * Return a Task that can be sent to a TaskTracker for execution. */ public Task getTaskToRun(String taskTracker) throws IOException { // 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()); //set this the first time we run a taskAttempt in this TIP //each Task attempt has its own TaskStatus, which tracks that //attempts execStartTime, thus this startTime is TIP wide. if (0 == execStartTime){ setExecStartTime(lastDispatchTime); } return addRunningTask(taskid, taskTracker); }
0, jip.getNumRestarts()); 2, jobtracker.recoveryManager.getRecovered()); assertEquals("Restart count is not correct", 1, jobtracker.getJob(rJob2.getID()).getNumRestarts());