Map<String, Long> getCompactionProgress(String partitionPath) throws CloudStorageException {
    // TODO: change return type to POJO with getters and serde methods
    String payload = requestAgent.doWithRetries(() -> {
      ByteArrayOutputStream baos = new ByteArrayOutputStream(CHECKPOINT_BUFFER_SIZE);
      boolean hasCheckpoint;
      try {
        hasCheckpoint =
            azureBlobDataAccessor.downloadFileAsync(AzureCloudDestination.CHECKPOINT_CONTAINER, partitionPath, null, baos,
                false).join();
        return hasCheckpoint ? baos.toString() : null;
      } catch (CompletionException e) {
        Exception ex = Utils.extractFutureExceptionCause(e);
        if (ex instanceof CosmosException) {
          throw toCloudStorageException("Error downloading compaction check point for partition" + partitionPath,
              Utils.extractFutureExceptionCause(e), azureMetrics);
        } else {
          throw new RuntimeException(ex);
        }
      }
    }, "Download compaction checkpoint", partitionPath);

    if (payload == null) {
      return new HashMap(emptyCheckpoints);
    }
    try {
      // Payload format: {"expirationTime" : 12345, "deletionTime" : 67890}
      ObjectNode jsonNode = (ObjectNode) objectMapper.readTree(payload);
      Map<String, Long> checkpoints = new HashMap<>();
      for (String fieldName : compactionFields) {
        checkpoints.put(fieldName, jsonNode.has(fieldName) ? jsonNode.get(fieldName).longValue() : DEFAULT_TIME);
      }
      return checkpoints;
    } catch (IOException e) {
      logger.error("Could not retrieve compaction progress for {}", partitionPath, e);
      azureMetrics.compactionProgressReadErrorCount.inc();
      return new HashMap(emptyCheckpoints);
    }
  }
Get the current compaction progress for a partition.
@param partitionPath the partition to check.
@return a {@link Map} containing the progress time for compaction based on deletion and expiration time.
@throws CloudStorageException if the operation fails.
ambry-cloud/src/main/java/com/github/ambry/cloud/azure/AzureStorageCompactor.java