From cb7907aef284f71a7cbcd03abc25fb97c51155cc Mon Sep 17 00:00:00 2001 From: Eli Collins Date: Thu, 12 Apr 2012 16:38:52 +0000 Subject: [PATCH] HADOOP-8144. svn merge -c 1325367 from trunk git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1325368 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 4 ++++ .../src/main/java/org/apache/hadoop/net/NetworkTopology.java | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 40d83227db0..02db9ac08b0 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -233,6 +233,10 @@ Release 2.0.0 - UNRELEASED HADOOP-8270. hadoop-daemon.sh stop action should return 0 for an already stopped service. (Roman Shaposhnik via eli) + HADOOP-8144. pseudoSortByDistance in NetworkTopology doesn't work + properly if no local node and first node is local rack node. + (Junping Du) + BREAKDOWN OF HADOOP-7454 SUBTASKS HADOOP-7455. HA: Introduce HA Service Protocol Interface. (suresh) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java index 67fddd7e583..da8fab2956c 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java @@ -662,8 +662,8 @@ public class NetworkTopology { */ public void pseudoSortByDistance( Node reader, Node[] nodes ) { int tempIndex = 0; + int localRackNode = -1; if (reader != null ) { - int localRackNode = -1; //scan the array to find the local node & local rack node for(int i=0; i