hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject svn commit: r1183450 - in /hadoop/common/branches/branch-0.22/hdfs: CHANGES.txt src/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java
Date Fri, 14 Oct 2011 18:10:05 GMT
Author: shv
Date: Fri Oct 14 18:10:04 2011
New Revision: 1183450

URL: http://svn.apache.org/viewvc?rev=1183450&view=rev
Log:
HDFS-2012. Balancer incorrectly treats nodes whose utilization equals avgUtilization. Contributed
by Uma Maheswara Rao G.

Modified:
    hadoop/common/branches/branch-0.22/hdfs/CHANGES.txt
    hadoop/common/branches/branch-0.22/hdfs/src/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java

Modified: hadoop/common/branches/branch-0.22/hdfs/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.22/hdfs/CHANGES.txt?rev=1183450&r1=1183449&r2=1183450&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.22/hdfs/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.22/hdfs/CHANGES.txt Fri Oct 14 18:10:04 2011
@@ -642,6 +642,9 @@ Release 0.22.0 - Unreleased
 
     HDFS-1762. Allow TestHDFSCLI to be run against a cluster (cos)
 
+    HDFS-2012. Balancer incorrectly treats nodes whose utilization equals
+    avgUtilization. (Uma Maheswara Rao G via shv)
+
 Release 0.21.1 - Unreleased
 
   IMPROVEMENTS

Modified: hadoop/common/branches/branch-0.22/hdfs/src/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.22/hdfs/src/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java?rev=1183450&r1=1183449&r2=1183450&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.22/hdfs/src/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java
(original)
+++ hadoop/common/branches/branch-0.22/hdfs/src/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java
Fri Oct 14 18:10:04 2011
@@ -997,7 +997,10 @@ public class Balancer implements Tool {
           this.aboveAvgUtilizedDatanodes.add((Source)datanodeS);
         } else {
           assert(isOverUtilized(datanodeS)) :
-            datanodeS.getName()+ "is not an overUtilized node";
+            datanodeS.getName()+ " is not an overUtilized node:" +
+            		" utilization=" + datanodeS.utilization +
+            		" avgUtilization=" + avgUtilization +
+            		" threshold=" + threshold;
           this.overUtilizedDatanodes.add((Source)datanodeS);
           overLoadedBytes += (long)((datanodeS.utilization-avgUtilization
               -threshold)*datanodeS.datanode.getCapacity()/100.0);
@@ -1008,7 +1011,10 @@ public class Balancer implements Tool {
           this.belowAvgUtilizedDatanodes.add(datanodeS);
         } else {
           assert (isUnderUtilized(datanodeS)) :
-            datanodeS.getName()+ "is not an underUtilized node"; 
+            datanodeS.getName()+ "is not an underUtilized node:" +
+            " utilization=" + datanodeS.utilization +
+            " avgUtilization=" + avgUtilization +
+            " threshold=" + threshold;
           this.underUtilizedDatanodes.add(datanodeS);
           underLoadedBytes += (long)((avgUtilization-threshold-
               datanodeS.utilization)*datanodeS.datanode.getCapacity()/100.0);
@@ -1440,11 +1446,11 @@ public class Balancer implements Tool {
     return datanode.utilization > (avgUtilization+threshold);
   }
   
-  /* Return true if the given datanode is above average utilized
+  /* Return true if the given datanode is above or equal to average utilized
    * but not overUtilized */
   private boolean isAboveAvgUtilized(BalancerDatanode datanode) {
     return (datanode.utilization <= (avgUtilization+threshold))
-        && (datanode.utilization > avgUtilization);
+        && (datanode.utilization >= avgUtilization);
   }
   
   /* Return true if the given datanode is underUtilized */



Mime
View raw message