@Override
  public SpaceQuotaSnapshot getTargetState(TableName table, SpaceQuota spaceQuota)
    throws IOException {
    rlock.lock();
    try {
      final long sizeLimitInBytes = spaceQuota.getSoftLimit();
      long sum = 0L;
      for (Entry<RegionInfo, Long> entry : filterBySubject(table)) {
        sum += entry.getValue();
      }
      // Add in the size for any snapshots against this table
      sum += getSnapshotSizesForTable(table);
      // Observance is defined as the size of the table being less than the limit
      SpaceQuotaStatus status = sum <= sizeLimitInBytes
        ? SpaceQuotaStatus.notInViolation()
        : new SpaceQuotaStatus(ProtobufUtil.toViolationPolicy(spaceQuota.getViolationPolicy()));
      return new SpaceQuotaSnapshot(status, sum, sizeLimitInBytes);
    } finally {
      rlock.unlock();
    }
  }
Fetches the table quota. Visible for mocking/testing.
hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/TableQuotaSnapshotStore.java