public void stopHeartbeat(long txnId) throws InterruptedException {
    LOG.info("Stopping heartbeat task for TXN {}", txnId);
    CompactionHeartbeater heartbeater = tasks.get(txnId);
    if (heartbeater == null) {
      throw new IllegalStateException("No registered heartbeat found for TXN " + txnId);
    }
    try {
      heartbeater.stop();
    } finally {
      tasks.remove(txnId);
    }
  }
Stops the heartbeat for the given transaction
@param txnId The id of the compaction txn
@throws IllegalStateException Thrown when there is no {@link CompactionHeartbeater} task associated with the
given txnId.
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CompactionHeartbeatService.java