@Override
  public void run() {
    try {
      long start = System.currentTimeMillis();
      isAliveCounter++;
      txnHandler.countOpenTxns();
      long now = System.currentTimeMillis();
      if (now - lastLogTime > LOG_INTERVAL_MS) {
        LOG.info("Open txn counter ran for {} seconds. isAliveCounter: {}", (now - start) / 1000, isAliveCounter);
        lastLogTime = now;
      }
    }
    catch (Exception e) {
      LOG.error("Unexpected exception in thread: {}, message: {}", Thread.currentThread().getName(), e.getMessage(), e);
    }
  }
Background running thread, periodically updating number of open transactions.
Runs inside Hive Metastore Service.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/service/AcidOpenTxnsCounterService.java