public static CompactionHeartbeatService getInstance(HiveConf conf) {
    if (instance == null) {
      synchronized (CompactionHeartbeatService.class) {
        if (instance == null) {
          LOG.debug("Initializing compaction txn heartbeater service.");
          instance = new CompactionHeartbeatService(conf);
          ShutdownHookManager.addShutdownHook(() -> instance.shutdown(), SHUTDOWN_HOOK_PRIORITY);
        }
      }
    }
    if (instance.shuttingDown) {
      throw new IllegalStateException("CompactionHeartbeatService is already destroyed!");
    }
    return instance;
  }
Return the singleton instance of this class.
@param conf The {@link HiveConf} used to create the service. Used only during the firsst call
@return Returns the singleton {@link CompactionHeartbeatService}
@throws IllegalStateException Thrown when the service has already been destroyed.
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CompactionHeartbeatService.java