hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r800621 - in /hadoop/hbase/branches/0.20: CHANGES.txt src/java/org/apache/hadoop/hbase/master/RegionManager.java
Date Mon, 03 Aug 2009 23:22:31 GMT
Author: stack
Date: Mon Aug  3 23:22:31 2009
New Revision: 800621

URL: http://svn.apache.org/viewvc?rev=800621&view=rev
Log:
HBASE-1737 Regions unbalanced when adding new node

Modified:
    hadoop/hbase/branches/0.20/CHANGES.txt
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java

Modified: hadoop/hbase/branches/0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/CHANGES.txt?rev=800621&r1=800620&r2=800621&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.20/CHANGES.txt Mon Aug  3 23:22:31 2009
@@ -313,6 +313,7 @@
                without throwing an exception (Eugene Kirpichov via Stack)
    HBASE-1739  hbase-1683 broke splitting; only split three logs no matter
                what N was
+   HBASE-1737  Regions unbalanced when adding new node
 
   IMPROVEMENTS
    HBASE-1089  Add count of regions on filesystem to master UI; add percentage

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java?rev=800621&r1=800620&r2=800621&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java
(original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java
Mon Aug  3 23:22:31 2009
@@ -1349,19 +1349,24 @@
       double avg = master.serverManager.getAverageLoad();
 
       // nothing to balance if server load not more then average load
-      if (servLoad.getLoad() <= Math.ceil(avg) || avg <= 2.0) return;
+      if(servLoad.getLoad() <= Math.ceil(avg) || avg <= 2.0) {
+        return;
+      }
       
-      // check if server is overloaded
+      // check if current server is overloaded
       int numRegionsToClose = balanceFromOverloaded(servLoad, avg);
       
       // check if we can unload server by low loaded servers
-      if (numRegionsToClose <= 0)
-        balanceToLowloaded(info.getServerName(), servLoad, avg);
+      if(numRegionsToClose <= 0) {
+        numRegionsToClose = balanceToLowloaded(info.getServerName(), servLoad, 
+            avg);
+      }
       
-      if (maxRegToClose > 0)
+      if(maxRegToClose > 0) {
         numRegionsToClose = Math.min(numRegionsToClose, maxRegToClose);
-              
-      if (numRegionsToClose > 0){
+      }
+      
+      if(numRegionsToClose > 0) {
         unassignSomeRegions(info, numRegionsToClose, mostLoadedRegions, 
             returnMsgs);
       }
@@ -1416,7 +1421,8 @@
       if (LOG.isDebugEnabled()) {
         LOG.debug("Server " + srvName + " will be unloaded for " +
             "balance. Server load: " + numSrvRegs + " avg: " +
-            avgLoad + ", regions can be moved: " + numMoveToLowLoaded);
+            avgLoad + ", regions can be moved: " + numMoveToLowLoaded +
+            ". Regions to close: " + numRegionsToClose);
       }
       return numRegionsToClose;
     }



Mime
View raw message