Skip to content

Commit

Permalink
HBASE-23954 SplitParent region should not be balanced (apache#1264)
Browse files Browse the repository at this point in the history
Co-authored-by: niuyulin <niuyulin@xiaomi.com>

Signed-off-by: Viraj Jasani <vjasani@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: stack <stack@apache.org>
  • Loading branch information
nyl3532016 authored and saintstack committed Mar 10, 2020
1 parent 6587a95 commit 9949204
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -547,6 +547,9 @@ public Map<TableName, Map<ServerName, List<RegionInfo>>> getAssignmentsForBalanc
if (isTableDisabled(tableStateManager, node.getTable())) {
continue;
}
if (node.getRegionInfo().isSplitParent()) {
continue;
}
Map<ServerName, List<RegionInfo>> tableResult =
result.computeIfAbsent(node.getTable(), t -> new HashMap<>());
final ServerName serverName = node.getRegionLocation();
Expand All @@ -569,9 +572,10 @@ public Map<TableName, Map<ServerName, List<RegionInfo>>> getAssignmentsForBalanc
for (ServerName serverName : onlineServers) {
ServerStateNode serverNode = serverMap.get(serverName);
if (serverNode != null) {
ensemble.put(serverNode.getServerName(), serverNode.getRegionInfoList().stream()
.filter(region -> !isTableDisabled(tableStateManager, region.getTable()))
.collect(Collectors.toList()));
ensemble.put(serverNode.getServerName(),
serverNode.getRegionInfoList().stream()
.filter(region -> !isTableDisabled(tableStateManager, region.getTable()))
.filter(region -> !region.isSplitParent()).collect(Collectors.toList()));
} else {
ensemble.put(serverName, new ArrayList<>());
}
Expand Down

0 comments on commit 9949204

Please sign in to comment.