/** * Gets the meta regions for the given path with the default replica ID. * * @param zkw ZooKeeper watcher to be used * @return List of meta regions */ public static List<RegionInfo> getMetaRegions(ZKWatcher zkw) { return getMetaRegions(zkw, RegionInfo.DEFAULT_REPLICA_ID); }
@Test public void testGetRegionsFromMetaTable() throws IOException, InterruptedException { List<RegionInfo> regions = MetaTableLocator.getMetaRegions(UTIL.getZooKeeperWatcher()); assertTrue(regions.size() >= 1); assertTrue(MetaTableLocator.getMetaRegionsAndLocations(UTIL.getZooKeeperWatcher()).size() >= 1); }
@Test public void testGetRegionsFromMetaTable() throws IOException, InterruptedException { List<RegionInfo> regions = new MetaTableLocator().getMetaRegions(UTIL.getZooKeeperWatcher()); assertTrue(regions.size() >= 1); assertTrue(new MetaTableLocator().getMetaRegionsAndLocations( UTIL.getZooKeeperWatcher()).size() >= 1); }
List<RegionInfo> regions; if (TableName.META_TABLE_NAME.equals(tableName)) { regions = MetaTableLocator.getMetaRegions(services.getZooKeeper()); } else { regions = MetaTableAccessor.getTableRegions(services.getConnection(), tableName);
/** * Gets the meta regions for the given path with the default replica ID. * * @param zkw ZooKeeper watcher to be used * @return List of meta regions */ public List<RegionInfo> getMetaRegions(ZKWatcher zkw) { return getMetaRegions(zkw, RegionInfo.DEFAULT_REPLICA_ID); }
/** * @param zkw ZooKeeper watcher to be used * @return List of meta regions */ public List<HRegionInfo> getMetaRegions(ZooKeeperWatcher zkw) { return getMetaRegions(zkw, HRegionInfo.DEFAULT_REPLICA_ID); }
/** * Used by the client to identify if all regions have the schema updates * * @param tableName * @return Pair indicating the status of the alter command * @throws IOException */ public Pair<Integer, Integer> getReopenStatus(TableName tableName) throws IOException { List<HRegionInfo> hris; if (TableName.META_TABLE_NAME.equals(tableName)) { hris = new MetaTableLocator().getMetaRegions(server.getZooKeeper()); } else { hris = MetaTableAccessor.getTableRegions(server.getZooKeeper(), server.getConnection(), tableName, true); } Integer pending = 0; for (HRegionInfo hri : hris) { String name = hri.getEncodedName(); // no lock concurrent access ok: sequential consistency respected. if (regionsToReopen.containsKey(name) || regionStates.isRegionInTransition(name)) { pending++; } } return new Pair<Integer, Integer>(pending, hris.size()); }
@Override public List<HRegionInfo> evaluate() throws IOException { if (TableName.META_TABLE_NAME.equals(tableName)) { return new MetaTableLocator().getMetaRegions(env.getMasterServices().getZooKeeper()); } return MetaTableAccessor.getTableRegions(env.getMasterServices().getZooKeeper(), env.getMasterServices().getConnection(), tableName); } });
List<HRegionInfo> regions; if (TableName.META_TABLE_NAME.equals(tableName)) { regions = new MetaTableLocator().getMetaRegions(services.getZooKeeper()); } else { regions = MetaTableAccessor.getTableRegions(services.getZooKeeper(),
hris = new MetaTableLocator().getMetaRegions(server.getZooKeeper()); } else { hris = MetaTableAccessor.getTableRegions(server.getZooKeeper(),