hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asur...@apache.org
Subject [37/50] [abbrv] hadoop git commit: HDFS-10319. Balancer should not try to pair storages with different types.
Date Fri, 22 Apr 2016 18:59:00 GMT
HDFS-10319. Balancer should not try to pair storages with different types.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/bbce1d52
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/bbce1d52
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/bbce1d52

Branch: refs/heads/yarn-2877
Commit: bbce1d525e0016c9b8e573b86af3c87aa39582bd
Parents: 3dce486
Author: Tsz-Wo Nicholas Sze <szetszwo@hortonworks.com>
Authored: Thu Apr 21 15:20:12 2016 -0700
Committer: Tsz-Wo Nicholas Sze <szetszwo@hortonworks.com>
Committed: Thu Apr 21 15:20:12 2016 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hdfs/server/balancer/Balancer.java  | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/bbce1d52/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java
index a7600e0..3169faf 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java
@@ -525,8 +525,7 @@ public class Balancer {
         final C c = candidates.next();
         if (!c.hasSpaceForScheduling()) {
           candidates.remove();
-        } else if (matcher.match(dispatcher.getCluster(),
-            g.getDatanodeInfo(), c.getDatanodeInfo())) {
+        } else if (matchStorageGroups(c, g, matcher)) {
           return c;
         }
       }
@@ -534,6 +533,13 @@ public class Balancer {
     return null;
   }
 
+  private boolean matchStorageGroups(StorageGroup left, StorageGroup right,
+      Matcher matcher) {
+    return left.getStorageType() == right.getStorageType()
+        && matcher.match(dispatcher.getCluster(),
+            left.getDatanodeInfo(), right.getDatanodeInfo());
+  }
+
   /* reset all fields in a balancer preparing for the next iteration */
   void resetData(Configuration conf) {
     this.overUtilized.clear();


Mime
View raw message