Reidddddd commented on a change in pull request #908: HBASE-23377 Balancer
should skip disabled tables's regions
URL: https://github.com/apache/hbase/pull/908#discussion_r354760052
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionStates.java
##########
@@ -561,14 +566,22 @@ public ServerName getRegionServerOfRegion(RegionInfo
regionInfo) {
} else {
final HashMap<ServerName, List<RegionInfo>> ensemble = new
HashMap<>(serverMap.size());
for (ServerStateNode serverNode : serverMap.values()) {
- ensemble.put(serverNode.getServerName(),
serverNode.getRegionInfoList());
+ ensemble.put(serverNode.getServerName(),
serverNode.getRegionInfoList().stream()
+ .filter(region -> !isTableDisabled(tableStateManager,
region.getTable()))
+ .collect(Collectors.toList()));
}
// Use a fake table name to represent the whole cluster's assignments
result.put(HConstants.ENSEMBLE_TABLE_NAME, ensemble);
}
return result;
}
+ public boolean isTableDisabled(final TableStateManager tableStateManager,
Review comment:
Can it be private?
It looks being static is also fine.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services