@Override
  public TaskResult run() {
    TaskResult taskResult = null;
    Timer.Context deprecationTaskRunTimer = vcrMetrics.deprecationTaskRunTime.time();
    try {
      logger.info("DeprecatedContainerCloudSyncTask run started.");
      Timer.Context accountServiceFetchTimer = vcrMetrics.accountServiceFetchTime.time();
      Set<Container> deprecatedContainers =
          AccountUtils.getDeprecatedContainers(accountService, containerDeletionRetentionDays);
      accountServiceFetchTimer.stop();
      logger.info("Attempting deprecation of {} containers.", deprecatedContainers.size());
      cloudDestination.deprecateContainers(deprecatedContainers);
      taskResult =
          new TaskResult(TaskResult.Status.COMPLETED, "DeprecatedContainerCloudSyncTask completed successfully.");
    } catch (CloudStorageException cloudStorageException) {
      logger.error("Error in updating deprecated containers from account service to cloud: ", cloudStorageException);
      taskResult = new TaskResult(TaskResult.Status.FAILED,
          "DeprecatedContainerCloudSyncTask failed due to ." + cloudStorageException.getMessage());
    } finally {
      logger.info("DeprecatedContainerCloudSyncTask done.");
      deprecationTaskRunTimer.stop();
    }
    return taskResult;
  }
Constructor for {@link DeprecatedContainerCloudSyncTask}.
@param accountService {@link AccountService} object.
@param containerDeletionRetentionDays retention days for a deprecated container.
@param cloudDestination the {@link CloudDestination} object where deprecated container information will be updated.
ambry-cloud/src/main/java/com/github/ambry/cloud/DeprecatedContainerCloudSyncTask.java