public static List<RegionInfo> getAllRegions(Connection connection,
    boolean excludeOfflinedSplitParents) throws IOException {
    List<Pair<RegionInfo, ServerName>> result;

    result = getTableRegionsAndLocations(connection, null, excludeOfflinedSplitParents);

    return getListOfRegionInfos(result);

  }
Lists all of the regions currently in META.
@param connection                  to connect with
@param excludeOfflinedSplitParents False if we are to include offlined/splitparents regions,
                                   true and we'll leave out offlined regions from returned list
@return List of all user-space regions.
hbase-server/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java