@Override
  public boolean isCompactionStopped(String partition, CloudStorageCompactor compactor) {
    if (shutdownCompaction.get()) {
      logger.info("[COMPACT] Stopping compaction for partition {} due to shutdown", partition);
      return true;
    }
    if (compactor != null && !compactor.isPartitionOwned(clusterMap.getPartitionIdByName(partition))) {
      logger.info("[COMPACT] Stopping compaction for partition {} due to loss of partition ownership", partition);
      return true;
    }
    return false;
  }
Compacts a partition
@param partitionPath the path of the partitions to compact.
@return the number of blobs erased from cloud
@throws CloudStorageException
ambry-cloud/src/main/java/com/github/ambry/cloud/azure/AzureCloudDestinationSync.java