int getNumRegions(TableName table) throws IOException {
      List<RegionInfo> regions = this.conn.getAdmin().getRegions(table);
      if (regions == null) {
        return 0;
      }
      // Filter the region replicas if any and return the original number of regions for a table.
      RegionReplicaUtil.removeNonDefaultRegions(regions);
      return regions.size();
    }
Computes the total number of regions in a table.
hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaObserverChore.java