hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject [24/49] git commit: HBASE-10729. Enable table doesn't balance out replicas evenly if the replicas were unassigned earlier
Date Sat, 28 Jun 2014 00:31:10 GMT
HBASE-10729. Enable table doesn't balance out replicas evenly if the replicas were unassigned
earlier

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/hbase-10070@1576964 13f79535-47bb-0310-9956-ffa450edef68


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

Branch: refs/heads/master
Commit: d723115058f01ee7851d3b652b10cf8eb8b2cf3b
Parents: 759cfb8
Author: Devaraj Das <ddas@apache.org>
Authored: Wed Mar 12 22:31:18 2014 +0000
Committer: Enis Soztutar <enis@apache.org>
Committed: Fri Jun 27 16:39:38 2014 -0700

----------------------------------------------------------------------
 .../hbase/master/handler/EnableTableHandler.java       | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/d7231150/hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/EnableTableHandler.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/EnableTableHandler.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/EnableTableHandler.java
index 52b6c9a..5e90232 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/EnableTableHandler.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/EnableTableHandler.java
@@ -201,10 +201,15 @@ public class EnableTableHandler extends EventHandler {
       // need to potentially create some regions for the replicas
       List<HRegionInfo> unrecordedReplicas = AssignmentManager.replicaRegionsNotRecordedInMeta(
           new HashSet<HRegionInfo>(regionsToAssign.keySet()), services);
-      for (HRegionInfo h : unrecordedReplicas) {
-        regionsToAssign.put(h, 
-            this.assignmentManager.getBalancer().randomAssignment(h,
-                serverManager.getOnlineServersList()));
+      Map<ServerName, List<HRegionInfo>> srvToUnassignedRegs =
+            this.assignmentManager.getBalancer().roundRobinAssignment(unrecordedReplicas,
+                serverManager.getOnlineServersList());
+      if (srvToUnassignedRegs != null) {
+        for (Map.Entry<ServerName, List<HRegionInfo>> entry : srvToUnassignedRegs.entrySet())
{
+          for (HRegionInfo h : entry.getValue()) {
+            regionsToAssign.put(h, entry.getKey());
+          }
+        }
       }
     }
     int regionsCount = regionsToAssign.size();


Mime
View raw message