Map<String, Long> computeSnapshotSizes(Multimap<TableName, String> snapshotsToComputeSize)
    throws IOException {
    final Map<String, Long> snapshotSizesByNamespace = new HashMap<>();
    final long start = System.nanoTime();
    for (Entry<TableName, Collection<String>> entry : snapshotsToComputeSize.asMap().entrySet()) {
      final TableName tn = entry.getKey();
      final Collection<String> snapshotNames = entry.getValue();

      // Get our notifier instance, this is tracking archivals that happen out-of-band of this chore
      FileArchiverNotifier notifier = getNotifierForTable(tn);

      // The total size consumed by all snapshots against this table
      long totalSnapshotSize = notifier.computeAndStoreSnapshotSizes(snapshotNames);
      // Bucket that size into the appropriate namespace
      snapshotSizesByNamespace.merge(tn.getNamespaceAsString(), totalSnapshotSize, Long::sum);
    }

    // Update the amount of time it took to compute the size of the snapshots for a table
    if (metrics != null) {
      metrics.incrementSnapshotSizeComputationTime((System.nanoTime() - start) / 1_000_000);
    }

    return snapshotSizesByNamespace;
  }
Computes the size of each snapshot provided given the current files referenced by the table.
@param snapshotsToComputeSize The snapshots to compute the size of
@return A mapping of table to snapshot created from that table and the snapshot's size.
hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/SnapshotQuotaObserverChore.java