hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jg...@apache.org
Subject svn commit: r807846 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/master/RegionManager.java
Date Tue, 25 Aug 2009 22:44:16 GMT
Author: jgray
Date: Tue Aug 25 22:44:15 2009
New Revision: 807846

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

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

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=807846&r1=807845&r2=807846&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Tue Aug 25 22:44:15 2009
@@ -5,6 +5,7 @@
   BUG FIXES
    HBASE-1791  Timeout in IndexRecordWriter (Bradford Stephens via Andrew
                Purtell)
+   HBASE-1737  Regions unbalanced when adding new node (recommit)
 
   IMPROVEMENTS
    HBASE-1760  Cleanup TODOs in HTable

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/RegionManager.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/RegionManager.java?rev=807846&r1=807845&r2=807846&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/RegionManager.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/RegionManager.java Tue Aug
25 22:44:15 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