Quellcode durchsuchen

reverting the change made to revision 669586

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@669587 13f79535-47bb-0310-9956-ffa450edef68
Hairong Kuang vor 17 Jahren
Ursprung
Commit
ab02b51317
2 geänderte Dateien mit 6 neuen und 6 gelöschten Zeilen
  1. 3 3
      CHANGES.txt
  2. 3 3
      src/hdfs/org/apache/hadoop/dfs/ReplicationTargetChooser.java

+ 3 - 3
CHANGES.txt

@@ -15,6 +15,9 @@ Trunk (unreleased changes)
     HADOOP-3563.  Refactor the distributed upgrade code so that it is 
     easier to identify datanode and namenode related code. (dhruba)
 
+    HADOOP-3576. Fix NullPointerException when renaming a directory
+    to its subdirectory. (Tse Wo (Nicholas), SZE via hairong) 
+
 Release 0.18.0 - Unreleased
 
   INCOMPATIBLE CHANGES
@@ -671,9 +674,6 @@ Release 0.17.1 - Unreleased
     HADOOP-1979. Speed up fsck by adding a buffered stream. (Lohit
     Vijaya Renu via omalley)
 
-    HADOOP-3576. Fix NullPointerException when renaming a directory
-    to its subdirectory. (Tse Wo (Nicholas), SZE via hairong)
-
 Release 0.17.0 - 2008-05-18
 
   INCOMPATIBLE CHANGES

+ 3 - 3
src/hdfs/org/apache/hadoop/dfs/ReplicationTargetChooser.java

@@ -449,10 +449,10 @@ class ReplicationTargetChooser {
         writer = nodes[0];
       }
       for(;index<nodes.length; index++) {
-        DatanodeDescriptor shortestNode = nodes[index];
-        int shortestDistance = clusterMap.getDistance(writer, shortestNode);
+        DatanodeDescriptor shortestNode = null;
+        int shortestDistance = Integer.MAX_VALUE;
         int shortestIndex = index;
-        for(int i=index+1; i<nodes.length; i++) {
+        for(int i=index; i<nodes.length; i++) {
           DatanodeDescriptor currentNode = nodes[i];
           int currentDistance = clusterMap.getDistance(writer, currentNode);
           if (shortestDistance>currentDistance) {