hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hair...@apache.org
Subject svn commit: r669614 - in /hadoop/core/branches/branch-0.18: CHANGES.txt src/hdfs/org/apache/hadoop/dfs/ReplicationTargetChooser.java
Date Thu, 19 Jun 2008 18:21:45 GMT
Author: hairong
Date: Thu Jun 19 11:21:45 2008
New Revision: 669614

URL: http://svn.apache.org/viewvc?rev=669614&view=rev
Log:
Merge -r 669606:669605 from trunk to 0.18 branch. Fixes: HADOOP-3576.

Modified:
    hadoop/core/branches/branch-0.18/CHANGES.txt
    hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/ReplicationTargetChooser.java

Modified: hadoop/core/branches/branch-0.18/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/CHANGES.txt?rev=669614&r1=669613&r2=669614&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.18/CHANGES.txt Thu Jun 19 11:21:45 2008
@@ -642,6 +642,9 @@
     HADOOP-3576. Fix NullPointerException when renaming a directory
     to its subdirectory. (Tse Wo (Nicholas), SZE via hairong)
 
+    HADOOP-3320. Fix NullPointerException in NetworkTopology.getDistance().
+    (hairong)
+
 Release 0.17.1 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/ReplicationTargetChooser.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/ReplicationTargetChooser.java?rev=669614&r1=669613&r2=669614&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/ReplicationTargetChooser.java
(original)
+++ hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/ReplicationTargetChooser.java
Thu Jun 19 11:21:45 2008
@@ -449,10 +449,10 @@
         writer = nodes[0];
       }
       for(;index<nodes.length; index++) {
-        DatanodeDescriptor shortestNode = null;
-        int shortestDistance = Integer.MAX_VALUE;
+        DatanodeDescriptor shortestNode = nodes[index];
+        int shortestDistance = clusterMap.getDistance(writer, shortestNode);
         int shortestIndex = index;
-        for(int i=index; i<nodes.length; i++) {
+        for(int i=index+1; i<nodes.length; i++) {
           DatanodeDescriptor currentNode = nodes[i];
           int currentDistance = clusterMap.getDistance(writer, currentNode);
           if (shortestDistance>currentDistance) {



Mime
View raw message