HBASE-18193 Master web UI presents the incorrect number of regions
This commit is contained in:
parent
61839d7143
commit
30817b922e
|
@ -686,7 +686,9 @@ public class RegionStates {
|
|||
}
|
||||
|
||||
for (RegionStateNode node: regionsMap.values()) {
|
||||
tableRegions.get(node.getState()).add(node.getRegionInfo());
|
||||
if (node.getTable().equals(tableName)) {
|
||||
tableRegions.get(node.getState()).add(node.getRegionInfo());
|
||||
}
|
||||
}
|
||||
return tableRegions;
|
||||
}
|
||||
|
|
|
@ -416,6 +416,25 @@ public class TestAsyncRegionAdminApi extends TestAsyncAdminBase {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetRegionByStateOfTable() throws Exception {
|
||||
final TableName tableName = TableName.valueOf("testGetRegionByStateOfTable");
|
||||
try {
|
||||
HRegionInfo hri = createTableAndGetOneRegion(tableName);
|
||||
|
||||
RegionStates regionStates =
|
||||
TEST_UTIL.getHBaseCluster().getMaster().getAssignmentManager().getRegionStates();
|
||||
assertTrue(regionStates.getRegionByStateOfTable(tableName)
|
||||
.get(RegionState.State.OPEN)
|
||||
.contains(hri));
|
||||
assertFalse(regionStates.getRegionByStateOfTable(TableName.valueOf("I_am_the_phantom"))
|
||||
.get(RegionState.State.OPEN)
|
||||
.contains(hri));
|
||||
} finally {
|
||||
TEST_UTIL.deleteTable(tableName);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMoveRegion() throws Exception {
|
||||
final TableName tableName = TableName.valueOf("testMoveRegion");
|
||||
|
|
Loading…
Reference in New Issue