HBASE-18193 Master web UI presents the incorrect number of regions
This commit is contained in:
parent
61839d7143
commit
30817b922e
|
@ -686,8 +686,10 @@ public class RegionStates {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (RegionStateNode node: regionsMap.values()) {
|
for (RegionStateNode node: regionsMap.values()) {
|
||||||
|
if (node.getTable().equals(tableName)) {
|
||||||
tableRegions.get(node.getState()).add(node.getRegionInfo());
|
tableRegions.get(node.getState()).add(node.getRegionInfo());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return tableRegions;
|
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
|
@Test
|
||||||
public void testMoveRegion() throws Exception {
|
public void testMoveRegion() throws Exception {
|
||||||
final TableName tableName = TableName.valueOf("testMoveRegion");
|
final TableName tableName = TableName.valueOf("testMoveRegion");
|
||||||
|
|
Loading…
Reference in New Issue