/** * Log killed reduce task attempt. * * @param taskAttemptId task attempt id * @param timestamp time stamp when task failed * @param hostName host name of the task attempt. * @param error error message of the task. * @param taskType Whether the attempt is cleanup or setup or reduce */ public void logReduceTaskKilled( TaskAttemptID taskAttemptId, long timestamp, String hostName, String error, String taskType) { if (disableHistory) { return; } JobID id = taskAttemptId.getJobID(); if (!this.jobId.equals(id)) { throw new RuntimeException("JobId from task: " + id + " does not match expected: " + jobId); } if (null != writers) { log( writers, RecordTypes.ReduceAttempt, new Keys[] { Keys.TASK_TYPE, Keys.TASKID, Keys.TASK_ATTEMPT_ID, Keys.TASK_STATUS, Keys.FINISH_TIME, Keys.HOSTNAME, Keys.ERROR }, new String[] { taskType, taskAttemptId.getTaskID().toString(), taskAttemptId.toString(), Values.KILLED.name(), String.valueOf(timestamp), hostName, error }); } }
/** * Logs job killed event. Closes the job history log file. * * @param timestamp time when job killed was issued in ms. * @param finishedMaps no finished map tasks. * @param finishedReduces no of finished reduce tasks. */ public void logKilled(long timestamp, int finishedMaps, int finishedReduces, Counters counters) { if (disableHistory) { return; } if (null != writers) { log( writers, RecordTypes.Job, new Keys[] { Keys.JOBID, Keys.FINISH_TIME, Keys.JOB_STATUS, Keys.FINISHED_MAPS, Keys.FINISHED_REDUCES, Keys.COUNTERS }, new String[] { jobId.toString(), String.valueOf(timestamp), Values.KILLED.name(), String.valueOf(finishedMaps), String.valueOf(finishedReduces), counters.makeEscapedCompactString() }, true); closeAndClear(writers); } }