@Override
  public void endTask(String queryId, Task<?> task) {
    String id = queryId + ":" + task.getId();
    TaskInfo ti = taskInfoMap.get(id);

    if (ti == null) {
      return;
    }
    log(RecordTypes.TaskEnd, ti.hm);
    taskInfoMap.remove(id);
  }
Write the a history record to history file.

@param rt
@param keyValMap
ql/src/java/org/apache/hadoop/hive/ql/history/HiveHistoryImpl.java