public static Map<String, Long> getObservedSnapshotSizes(Connection conn) throws IOException {
    try (Table quotaTable = conn.getTable(QUOTA_TABLE_NAME);
      ResultScanner rs = quotaTable.getScanner(createScanForSpaceSnapshotSizes())) {
      final Map<String, Long> snapshotSizes = new HashMap<>();
      for (Result r : rs) {
        CellScanner cs = r.cellScanner();
        while (cs.advance()) {
          Cell c = cs.current();
          final String snapshot = extractSnapshotNameFromSizeCell(c);
          final long size = parseSnapshotSize(c);
          snapshotSizes.put(snapshot, size);
        }
      }
      return snapshotSizes;
    }
  }
Fetches any persisted HBase snapshot sizes stored in the quota table. The sizes here are
computed relative to the table which the snapshot was created from. A snapshot's size will not
include the size of files which the table still refers. These sizes, in bytes, are what is used
internally to compute quota violation for tables and namespaces.
@return A map of snapshot name to size in bytes per space quota computations
hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaTableUtil.java