hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject svn commit: r1504936 - /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/DefaultLoadBalancer.java
Date Fri, 19 Jul 2013 16:54:37 GMT
Author: larsh
Date: Fri Jul 19 16:54:37 2013
New Revision: 1504936

URL: http://svn.apache.org/r1504936
Log:
BASE-8432 a table with unbalanced regions will balance indefinitely with the 'org.apache.hadoop.hbase.master.DefaultLoadBalancer'
(Wang Qiang and Ted)

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/DefaultLoadBalancer.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/DefaultLoadBalancer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/DefaultLoadBalancer.java?rev=1504936&r1=1504935&r2=1504936&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/DefaultLoadBalancer.java
(original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/DefaultLoadBalancer.java
Fri Jul 19 16:54:37 2013
@@ -330,8 +330,8 @@ public class DefaultLoadBalancer impleme
       if (regionsToPut == 0)
       {
         regionsToPut = 1;
-        maxToTake--;
       }
+      maxToTake -= regionsToPut;
       underloadedServers.put(server.getKey().getServerName(), regionsToPut);
     }
     // number of servers that get new regions
@@ -439,6 +439,10 @@ public class DefaultLoadBalancer impleme
       for (Map.Entry<ServerAndLoad, List<HRegionInfo>> server :
         serversByLoad.entrySet()) {
         int regionCount = server.getKey().getLoad();
+        BalanceInfo balanceInfo = serverBalanceInfo.get(server.getKey().getServerName());
+        if(balanceInfo != null) {
+          regionCount += balanceInfo.getNumRegionsAdded();
+        }
         if(regionCount >= max) {
           break;
         }



Mime
View raw message