private Set<ServerName> getRegionServersOfTable(RegionLocator regionLocator) throws IOException {
    // The region locations could contain `null` ServerName instances if the region is currently
    // in transition, we filter those out for now, which impacts the size calculation for these
    // regions temporarily until the ServerName gets filled in later
    return regionLocator.getAllRegionLocations().stream().map(HRegionLocation::getServerName)
      .filter(Objects::nonNull).collect(Collectors.toSet());
  }
Computes size of each region for table and given column families.
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/RegionSizeCalculator.java