boolean updateCompactionProgress(String partitionPath, String fieldName, long progressTime) {
    try {
      // load existing progress checkpoint.
      Map<String, Long> checkpoints = getCompactionProgress(partitionPath);
      // Ensure we don't downgrade progress already recorded.
      if (progressTime <= checkpoints.getOrDefault(fieldName, DEFAULT_TIME)) {
        logger.info("Skipping update of compaction progress for {} because saved {} is more recent.", partitionPath,
            fieldName);
        return false;
      }
      checkpoints.put(fieldName, Math.max(progressTime, checkpoints.get(fieldName)));
      String json = objectMapper.writeValueAsString(checkpoints);
      ByteArrayInputStream bais = new ByteArrayInputStream(json.getBytes());
      requestAgent.doWithRetries(() -> {
        try {
          azureBlobDataAccessor.uploadFileAsync(AzureCloudDestination.CHECKPOINT_CONTAINER, partitionPath, bais).join();
          return null;
        } catch (CompletionException e) {
          Exception ex = Utils.extractFutureExceptionCause(e);
          if (ex instanceof CosmosException) {
            throw toCloudStorageException("Error updating compaction progress for partition" + partitionPath,
                Utils.extractFutureExceptionCause(e), azureMetrics);
          } else {
            throw new RuntimeException(ex);
          }
        }
      }, "Update compaction progress", partitionPath);
      logger.info("Marked compaction of partition {} complete up to {} {}", partitionPath, fieldName,
          new Date(progressTime));
      return true;
    } catch (CloudStorageException | IOException e) {
      logger.error("Could not save compaction progress for {}", partitionPath, e);
      azureMetrics.compactionProgressWriteErrorCount.inc();
      return false;
    }
  }
Update the compaction progress for a partition.
@param partitionPath the partition to update.
@param fieldName the compaction field (deletion or expiration time).
@param progressTime the updated progress time.
@return true if the checkpoint file was updated, otherwise false.
ambry-cloud/src/main/java/com/github/ambry/cloud/azure/AzureStorageCompactor.java