From 6e6b241e2bfec8a3f618a8e91bd86ab6ee8048c6 Mon Sep 17 00:00:00 2001 From: niuyulin Date: Wed, 11 Mar 2020 02:14:43 +0800 Subject: [PATCH] HBASE-23954 SplitParent region should not be balanced (#1264) Co-authored-by: niuyulin Signed-off-by: Viraj Jasani Signed-off-by: Guanghao Zhang Signed-off-by: stack --- .../hadoop/hbase/master/assignment/RegionStates.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionStates.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionStates.java index 356b0866976..6a6e3312762 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionStates.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionStates.java @@ -559,6 +559,9 @@ public class RegionStates { if (isTableDisabled(tableStateManager, node.getTable())) { continue; } + if (node.getRegionInfo().isSplitParent()) { + continue; + } Map> tableResult = result.computeIfAbsent(node.getTable(), t -> new HashMap<>()); final ServerName serverName = node.getRegionLocation(); @@ -581,9 +584,10 @@ public class RegionStates { 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<>()); }