HBASE-23954 SplitParent region should not be balanced (#1264)

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>
This commit is contained in:
niuyulin 2020-03-11 02:14:43 +08:00 committed by stack
parent 26617df373
commit 30637f2e5f
1 changed files with 7 additions and 3 deletions

View File

@ -550,6 +550,9 @@ public class RegionStates {
if (isTableDisabled(tableStateManager, node.getTable())) { if (isTableDisabled(tableStateManager, node.getTable())) {
continue; continue;
} }
if (node.getRegionInfo().isSplitParent()) {
continue;
}
Map<ServerName, List<RegionInfo>> tableResult = Map<ServerName, List<RegionInfo>> tableResult =
result.computeIfAbsent(node.getTable(), t -> new HashMap<>()); result.computeIfAbsent(node.getTable(), t -> new HashMap<>());
final ServerName serverName = node.getRegionLocation(); final ServerName serverName = node.getRegionLocation();
@ -572,9 +575,10 @@ public class RegionStates {
for (ServerName serverName : onlineServers) { for (ServerName serverName : onlineServers) {
ServerStateNode serverNode = serverMap.get(serverName); ServerStateNode serverNode = serverMap.get(serverName);
if (serverNode != null) { if (serverNode != null) {
ensemble.put(serverNode.getServerName(), serverNode.getRegionInfoList().stream() ensemble.put(serverNode.getServerName(),
.filter(region -> !isTableDisabled(tableStateManager, region.getTable())) serverNode.getRegionInfoList().stream()
.collect(Collectors.toList())); .filter(region -> !isTableDisabled(tableStateManager, region.getTable()))
.filter(region -> !region.isSplitParent()).collect(Collectors.toList()));
} else { } else {
ensemble.put(serverName, new ArrayList<>()); ensemble.put(serverName, new ArrayList<>());
} }