hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [15/21] hbase git commit: HBASE-16133 RSGroupBasedLoadBalancer.retainAssignment() might miss a region
Date Wed, 19 Jul 2017 00:44:57 GMT
HBASE-16133 RSGroupBasedLoadBalancer.retainAssignment() might miss a region


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/1a8db068
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/1a8db068
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/1a8db068

Branch: refs/heads/HBASE-15631-branch-1
Commit: 1a8db068c7022321b4a54d8b6d736d83578135c1
Parents: 2669cca
Author: Andrew Purtell <apurtell@apache.org>
Authored: Wed Jul 5 15:43:46 2017 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Tue Jul 18 17:44:31 2017 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/rsgroup/RSGroupBasedLoadBalancer.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/1a8db068/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupBasedLoadBalancer.java
----------------------------------------------------------------------
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 f69f093..c1b3c7d 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<ServerName> candidateList = filterOfflineServers(info, servers);
         ServerName server = this.internalBalancer.randomAssignment(region,
             candidateList);
-        if (server != null && !assignments.containsKey(server)) {
-          assignments.put(server, new ArrayList<HRegionInfo>());
-        } else if (server != null) {
+        if (server != null) {
+          if (!assignments.containsKey(server)) {
+            assignments.put(server, new ArrayList<HRegionInfo>());
+          }
           assignments.get(server).add(region);
         } else {
           //if not server is available assign to bogus so it ends up in RIT


Mime
View raw message