/** * Lists all of the regions currently in META. * @param conf * @return List of all user-space regions. * @throws IOException */ public static List<HRegionInfo> listAllRegions(Configuration conf) throws IOException { return listAllRegions(conf, true); }
@Override public HTableDescriptor[] listTables(String regex) throws IOException { Set<TableName> tableNameSet = new TreeSet<>(); for (HRegionInfo hRegionInfo : MetaScanner.listAllRegions(getConfiguration(), true)) { TableName tableName = hRegionInfo.getTable(); if (!tableName.getNameAsString().startsWith("hbase:")) { if (regex == null) { tableNameSet.add(tableName); } else { if (tableName.getNameAsString().matches(regex)) tableNameSet.add(tableName); } } } HTableDescriptor[] hTableDescriptors = new HTableDescriptor[tableNameSet.size()]; int i = 0; for (TableName tableName : tableNameSet) { hTableDescriptors[i++] = new HTableDescriptor(tableName); } return hTableDescriptors; }
public void checkRegionBoundaries() { try { ByteArrayComparator comparator = new ByteArrayComparator(); List<HRegionInfo> regions = MetaScanner.listAllRegions(getConf(), connection, false); final RegionBoundariesInformation currentRegionBoundariesInformation = new RegionBoundariesInformation();