hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szets...@apache.org
Subject svn commit: r1080836 - in /hadoop/hdfs/trunk: CHANGES.txt src/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java
Date Sat, 12 Mar 2011 01:27:06 GMT
Author: szetszwo
Date: Sat Mar 12 01:27:06 2011
New Revision: 1080836

URL: http://svn.apache.org/viewvc?rev=1080836&view=rev
Log:
HDFS-1748. Balancer utilization classification is incomplete.

Modified:
    hadoop/hdfs/trunk/CHANGES.txt
    hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java

Modified: hadoop/hdfs/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=1080836&r1=1080835&r2=1080836&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Sat Mar 12 01:27:06 2011
@@ -115,6 +115,8 @@ Trunk (unreleased changes)
     HDFS-1738. change hdfs jmxget to return an empty string instead of 
     null when an attribute value is not available (tanping vi boryas)
 
+    HDFS-1748. Balancer utilization classification is incomplete.  (szetszwo)
+
 Release 0.22.0 - Unreleased
 
   NEW FEATURES

Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java?rev=1080836&r1=1080835&r2=1080836&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java (original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java Sat Mar
12 01:27:06 2011
@@ -1004,11 +1004,12 @@ public class Balancer implements Tool {
         }
       } else {
         datanodeS = new BalancerDatanode(datanode, avgUtilization, threshold);
-        if ( isBelowAvgUtilized(datanodeS)) {
+        if ( isBelowOrEqualAvgUtilized(datanodeS)) {
           this.belowAvgUtilizedDatanodes.add(datanodeS);
         } else {
-          assert (isUnderUtilized(datanodeS)) :
-            datanodeS.getName()+ "is not an underUtilized node"; 
+          assert isUnderUtilized(datanodeS) : "isUnderUtilized("
+              + datanodeS.getName() + ")=" + isUnderUtilized(datanodeS)
+              + ", utilization=" + datanodeS.utilization; 
           this.underUtilizedDatanodes.add(datanodeS);
           underLoadedBytes += (long)((avgUtilization-threshold-
               datanodeS.utilization)*datanodeS.datanode.getCapacity()/100.0);
@@ -1454,9 +1455,9 @@ public class Balancer implements Tool {
 
   /* Return true if the given datanode is below average utilized 
    * but not underUtilized */
-  private boolean isBelowAvgUtilized(BalancerDatanode datanode) {
+  private boolean isBelowOrEqualAvgUtilized(BalancerDatanode datanode) {
         return (datanode.utilization >= (avgUtilization-threshold))
-                 && (datanode.utilization < avgUtilization);
+                 && (datanode.utilization <= avgUtilization);
   }
 
   // Exit status



Mime
View raw message