hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szets...@apache.org
Subject hadoop git commit: HDFS-10335 Mover$Processor#chooseTarget() always chooses the first matching target storage group. Contributed by Mingliang Liu
Date Fri, 29 Apr 2016 18:26:34 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 ac8fb579c -> fe3c2886b


HDFS-10335 Mover$Processor#chooseTarget() always chooses the first matching target storage
group.  Contributed by  Mingliang Liu


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

Branch: refs/heads/branch-2
Commit: fe3c2886be38b1a75ce63fb476004cc5ead43bf2
Parents: ac8fb57
Author: Tsz-Wo Nicholas Sze <szetszwo@hortonworks.com>
Authored: Fri Apr 29 11:22:33 2016 -0700
Committer: Tsz-Wo Nicholas Sze <szetszwo@hortonworks.com>
Committed: Fri Apr 29 11:24:32 2016 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/hdfs/server/mover/Mover.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/fe3c2886/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/mover/Mover.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/mover/Mover.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/mover/Mover.java
index 374ad5e..3c63263 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/mover/Mover.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/mover/Mover.java
@@ -457,7 +457,9 @@ public class Mover {
         List<StorageType> targetTypes, Matcher matcher) {
       final NetworkTopology cluster = dispatcher.getCluster(); 
       for (StorageType t : targetTypes) {
-        for(StorageGroup target : storages.getTargetStorages(t)) {
+        final List<StorageGroup> targets = storages.getTargetStorages(t);
+        Collections.shuffle(targets);
+        for (StorageGroup target : targets) {
           if (matcher.match(cluster, source.getDatanodeInfo(),
               target.getDatanodeInfo())) {
             final PendingMove pm = source.addPendingMove(db, target);


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message