/** * The job is done since all it's component tasks are either * successful or have failed. * * @param metrics job-tracker metrics */ private void jobComplete(JobTrackerInstrumentation metrics) { // // All tasks are complete, then the job is done! // if (this.status.getRunState() == JobStatus.RUNNING ) { this.status.setRunState(JobStatus.SUCCEEDED); this.status.setCleanupProgress(1.0f); this.finishTime = System.currentTimeMillis(); LOG.info("Job " + this.status.getJobID() + " has completed successfully."); JobHistory.JobInfo.logFinished(this.status.getJobID(), finishTime, this.finishedMapTasks, this.finishedReduceTasks, failedMapTasks, failedReduceTasks, getCounters()); // Note that finalize will close the job history handles which garbage collect // might try to finalize garbageCollect(); metrics.completeJob(this.conf, this.status.getJobID()); } }
private synchronized void terminateJob(int jobTerminationState) { if ((status.getRunState() == JobStatus.RUNNING) || (status.getRunState() == JobStatus.PREP)) { if (jobTerminationState == JobStatus.FAILED) { this.status = new JobStatus(status.getJobID(), 1.0f, 1.0f, 1.0f, JobStatus.FAILED, status.getJobPriority()); this.finishTime = System.currentTimeMillis(); JobHistory.JobInfo.logFailed(this.status.getJobID(), finishTime, this.finishedMapTasks, this.finishedReduceTasks); } else { this.status = new JobStatus(status.getJobID(), 1.0f, 1.0f, 1.0f, JobStatus.KILLED, status.getJobPriority()); this.finishTime = System.currentTimeMillis(); JobHistory.JobInfo.logKilled(this.status.getJobID(), finishTime, this.finishedMapTasks, this.finishedReduceTasks); } garbageCollect(); } }
this.finishedReduceTasks, counters); garbageCollect();
jobHistory.closeWriter(this.status.getJobID()); garbageCollect();