HBASE-18193 Master web UI presents the incorrect number of regions
This commit is contained in:
parent
a81577d827
commit
922894c96e
|
@ -686,7 +686,9 @@ public class RegionStates {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (RegionStateNode node: regionsMap.values()) {
|
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;
|
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