protected static void parseUserResult(final String userName, final Result result,
    final UserQuotasVisitor visitor) throws IOException {
    Map<byte[], byte[]> familyMap = result.getFamilyMap(QUOTA_FAMILY_INFO);
    if (familyMap == null || familyMap.isEmpty()) return;

    for (Map.Entry<byte[], byte[]> entry : familyMap.entrySet()) {
      Quotas quotas = quotasFromData(entry.getValue());
      if (Bytes.startsWith(entry.getKey(), QUOTA_QUALIFIER_SETTINGS_PREFIX)) {
        String name = Bytes.toString(entry.getKey(), QUOTA_QUALIFIER_SETTINGS_PREFIX.length);
        if (name.charAt(name.length() - 1) == TableName.NAMESPACE_DELIM) {
          String namespace = name.substring(0, name.length() - 1);
          visitor.visitUserQuotas(userName, namespace, quotas);
        } else {
          TableName table = TableName.valueOf(name);
          visitor.visitUserQuotas(userName, table, quotas);
        }
      } else if (Bytes.equals(entry.getKey(), QUOTA_QUALIFIER_SETTINGS)) {
        visitor.visitUserQuotas(userName, quotas);
      }
    }
  }
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