public synchronized void init(HiveConf conf) {
    if (!isInitialised) {
      this.conf = conf;
      this.executorService.scheduleAtFixedRate(new MetricSinkWriter(conf), 0,
        getFrequencyInSecs(), TimeUnit.SECONDS);
      isInitialised = true;
      LOG.debug("Metrics Sink Initialised with frequency {} ", getFrequencyInSecs());
    }
  }
MetricSink.
Scheduled thread to poll from Metric Collector and persists to DB
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/metric/MetricSink.java