code: public void logFailed(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.FAILED.name(),
                          String.valueOf(finishedMaps),
                          String.valueOf(finishedReduces),
                          counters.makeEscapedCompactString()},
                          true);
        closeAndClear(writers);
      }
    }
docs: Logs job failed event. Closes the job history log file.
  @param timestamp time when job failure was detected in ms.
  @param finishedMaps no finished map tasks.
  @param finishedReduces no of finished reduce tasks.