void pause() throws StoreException, IOException {
    hardDeleteLock.lock();
    try {
      if (paused.compareAndSet(false, true)) {
        logger.info("HardDelete thread has been paused ");
        index.persistIndex();
        persistFileLock.lock();
        try {
          // PersistCleanupToken because paused changed.
          pruneHardDeleteRecoveryRange();
          persistCleanupToken();
        } finally {
          persistFileLock.unlock();
        }
      }
    } finally {
      hardDeleteLock.unlock();
    }
  }
Pauses hard deletes. This guarantees that any on-going hard deletes have been completed, flushed and persisted and
the hard delete tokens are persisted before returning from pause. Hard delete will be in a paused state until
{@link #resume()} is called.
ambry-store/src/main/java/com/github/ambry/store/HardDeleter.java