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