private CompletableFuture<Void> doFlush() {
    LOG.debug("Submitting a job to flush {} history records", queryHistoryQueue.size());
    return CompletableFuture.runAsync(() -> repository.flush(queryHistoryQueue), flushExecutor);
  }
Creates a Query History record from a given DriverContext and adds it to the queue.
This is done asynchronously to completely decouple from the threads that run the query to make this service work
silently in the background.
@param driverContext a DriverContext containing all the needed information for a record to be created
ql/src/java/org/apache/hadoop/hive/ql/queryhistory/QueryHistoryService.java