private void removeInvalidAggregatedPartitionClassStats(AggregatedPartitionClassStorageStats currentStats)
      throws Exception {
    List<Pair<String, Pair<Short, Short>>> toBeDeletedPartitionClassNameAndAccountContainer = new ArrayList<>();
    AggregatedPartitionClassStorageStats existingStats = accountStatsStore.queryAggregatedPartitionClassStorageStats();
    for (String partitionClassName : existingStats.getStorageStats().keySet()) {
      Map<Short, Map<Short, ContainerStorageStats>> currentAccountMap =
          currentStats.getStorageStats().get(partitionClassName);
      for (Map.Entry<Short, Map<Short, ContainerStorageStats>> accountEntry : existingStats.getStorageStats()
          .get(partitionClassName)
          .entrySet()) {
        short accountId = accountEntry.getKey();
        for (short containerId : accountEntry.getValue().keySet()) {
          if (currentAccountMap == null || !currentAccountMap.containsKey(accountId) || !currentAccountMap.get(
              accountId).containsKey(containerId)) {
            toBeDeletedPartitionClassNameAndAccountContainer.add(
                new Pair<>(partitionClassName, new Pair<>(accountId, containerId)));
          }
        }
      }
    }
    for (Pair<String, Pair<Short, Short>> pair : toBeDeletedPartitionClassNameAndAccountContainer) {
      Pair<Short, Short> accountContainerId = pair.getSecond();
      accountStatsStore.deleteAggregatedPartitionClassStatsForAccountContainer(pair.getFirst(),
          accountContainerId.getFirst(), accountContainerId.getSecond());
    }
  }
Instantiates {@link MySqlReportAggregatorTask}.
@param manager The {@link HelixManager} to retrieve all storage nodes.
@param relevantTimePeriodInMs relevant time period in ms within which values are considered to be valid. Values
                              outside of this period will be ignored.
@param statsReportType the type of stats report
@param accountStatsStore The {@link AccountStatsStore} to retrieve stats and store aggregated stats.
@param callback a callback which will be invoked when the aggregation report has been generated successfully.
@param clusterMapConfig the {@link ClusterMapConfig} associated with helix participant.
@param registry the {@link MetricRegistry}.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/MySqlReportAggregatorTask.java