public static void extractQuotaSnapshot(Result result,
    Map<TableName, SpaceQuotaSnapshot> snapshots) {
    byte[] row = Objects.requireNonNull(result).getRow();
    if (row == null || row.length == 0) {
      throw new IllegalArgumentException("Provided result had a null row");
    }
    final TableName targetTableName = getTableFromRowKey(row);
    Cell c = result.getColumnLatestCell(QUOTA_FAMILY_USAGE, QUOTA_QUALIFIER_POLICY);
    if (c == null) {
      throw new IllegalArgumentException("Result did not contain the expected column "
        + QUOTA_POLICY_COLUMN + ", " + result.toString());
    }
    ByteString buffer =
      UnsafeByteOperations.unsafeWrap(c.getValueArray(), c.getValueOffset(), c.getValueLength());
    try {
      QuotaProtos.SpaceQuotaSnapshot snapshot = QuotaProtos.SpaceQuotaSnapshot.parseFrom(buffer);
      snapshots.put(targetTableName, SpaceQuotaSnapshot.toSpaceQuotaSnapshot(snapshot));
    } catch (InvalidProtocolBufferException e) {
      throw new IllegalArgumentException(
        "Result did not contain a valid SpaceQuota protocol buffer message", e);
    }
  }
Extracts the {@link SpaceViolationPolicy} and {@link TableName} from the provided
{@link Result} and adds them to the given {@link Map}. If the result does not contain the
expected information or the serialized policy in the value is invalid, this method will throw
an {@link IllegalArgumentException}.
@param result    A row from the quota table.
@param snapshots A map of snapshots to add the result of this method into.
hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaTableUtil.java