From bc70dc00bb05580bdc597cedf152f8add1f48d90 Mon Sep 17 00:00:00 2001 From: Enis Soztutar Date: Fri, 1 Jul 2016 09:28:41 -0700 Subject: [PATCH] HBASE-16133 RSGroupBasedLoadBalancer.retainAssignment() might miss a region --- .../hadoop/hbase/rsgroup/RSGroupBasedLoadBalancer.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupBasedLoadBalancer.java b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupBasedLoadBalancer.java index 14bc442cc63..0e7f26703e0 100644 --- a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupBasedLoadBalancer.java +++ b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupBasedLoadBalancer.java @@ -216,9 +216,10 @@ public class RSGroupBasedLoadBalancer implements RSGroupableBalancer, LoadBalanc List candidateList = filterOfflineServers(info, servers); ServerName server = this.internalBalancer.randomAssignment(region, candidateList); - if (server != null && !assignments.containsKey(server)) { - assignments.put(server, new ArrayList()); - } else if (server != null) { + if (server != null) { + if (!assignments.containsKey(server)) { + assignments.put(server, new ArrayList()); + } assignments.get(server).add(region); } else { //if not server is available assign to bogus so it ends up in RIT