public void start() {
    repository.init(conf, new Schema());

    flushExecutor = Executors.newFixedThreadPool(1,
        new ThreadFactoryBuilder().setNameFormat("QueryHistoryService repository thread").setDaemon(true)
            .setThreadFactory(r -> new QueryHistoryThread(r, conf)).build());

    if (flushInterval > 0) {
      // only flush, don't wait, this is a background task
      periodicFlushExecutor.scheduleAtFixedRate(this::doFlush, 0, flushInterval, TimeUnit.SECONDS);
    }
  }
Start method actually starts the service in a sense that it initializes the repository (which might involve
database operations) and starts the executor that's responsible for flushing records.
ql/src/java/org/apache/hadoop/hive/ql/queryhistory/QueryHistoryService.java