private List<HRegion> getRegionsToSnapshot(SnapshotDescription snapshot) throws IOException {
    List<HRegion> onlineRegions =
      (List<HRegion>) rss.getRegions(TableName.valueOf(snapshot.getTable()));
    Iterator<HRegion> iterator = onlineRegions.iterator();
    // remove the non-default regions
    while (iterator.hasNext()) {
      HRegion r = iterator.next();
      if (!RegionReplicaUtil.isDefaultReplica(r.getRegionInfo())) {
        iterator.remove();
      }
    }
    return onlineRegions;
  }
Determine if the snapshot should be handled on this server NOTE: This is racy -- the master
expects a list of regionservers. This means if a region moves somewhere between the calls we'll
miss some regions. For example, a region move during a snapshot could result in a region to be
skipped or done twice. This is manageable because the {@link MasterSnapshotVerifier} will
double check the region lists after the online portion of the snapshot completes and will
explicitly fail the snapshot.
@return the list of online regions. Empty list is returned if no regions are responsible for
        the given snapshot.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/snapshot/RegionServerSnapshotManager.java