public void deprecateContainers(Collection<Container> deprecatedContainers, Collection<String> partitionIds)
      throws CloudStorageException {
    if (deprecatedContainers.isEmpty() || partitionIds.isEmpty()) {
      logger.warn(
          "Got either empty container set or empty partition list. Skipping update deprecated containers to cloud.");
      return;
    }
    latestContainerDeletionTimestamp = getLatestContainerDeletionTime();
    Set<CosmosContainerDeletionEntry> cosmosContainerDeletionEntries = deprecatedContainers.stream()
        .filter(container -> container.getDeleteTriggerTime() >= latestContainerDeletionTimestamp)
        .map(container -> CosmosContainerDeletionEntry.fromContainer(container, partitionIds))
        .collect(Collectors.toSet());
    long newLastUpdateContainerTimestamp =
        requestAgent.doWithRetries(() -> cosmosDataAccessor.deprecateContainers(cosmosContainerDeletionEntries),
            "updateDeprecatedContainers", null);
    logger.info(String.format("Deprecated %d new containers from %d timestamp", cosmosContainerDeletionEntries.size(),
        latestContainerDeletionTimestamp));
    vcrMetrics.deprecatedContainerCount.inc(cosmosContainerDeletionEntries.size());
    if (newLastUpdateContainerTimestamp != -1) {
      saveLatestContainerDeletionTime(newLastUpdateContainerTimestamp);
      latestContainerDeletionTimestamp = newLastUpdateContainerTimestamp;
    }
  }
Update newly deprecated containers from {@code deprecatedContainers} to CosmosDb since last checkpoint.
This method is one of the two entry points in {@link AzureContainerCompactor} along with
{@link AzureContainerCompactor#compactAssignedDeprecatedContainers(Collection)}.
@param deprecatedContainers {@link Collection} of deprecated {@link Container}s.
@param partitionIds list of partition ids from where the containers have to be removed.
@throws CloudStorageException in case of any error.
ambry-cloud/src/main/java/com/github/ambry/cloud/azure/AzureContainerCompactor.java