hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hair...@apache.org
Subject svn commit: r670686 - in /hadoop/core/trunk: CHANGES.txt src/core/org/apache/hadoop/net/NetworkTopology.java
Date Mon, 23 Jun 2008 17:50:16 GMT
Author: hairong
Date: Mon Jun 23 10:50:16 2008
New Revision: 670686

URL: http://svn.apache.org/viewvc?rev=670686&view=rev
Log:
HADOOP-3537. Disallow adding a datanode to a network topology when its network location is
resolved. Contributed by Hairong Kuang.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/core/org/apache/hadoop/net/NetworkTopology.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=670686&r1=670685&r2=670686&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Mon Jun 23 10:50:16 2008
@@ -701,6 +701,9 @@
     HADOOP-3320. Fix NullPointerException in NetworkTopology.getDistance().
     (hairong)
 
+    HADOOP-3537. Disallow adding a datanode to a network topology when its
+    network location is not resolved. (hairong)
+
 Release 0.17.0 - 2008-05-18
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/trunk/src/core/org/apache/hadoop/net/NetworkTopology.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/core/org/apache/hadoop/net/NetworkTopology.java?rev=670686&r1=670685&r2=670686&view=diff
==============================================================================
--- hadoop/core/trunk/src/core/org/apache/hadoop/net/NetworkTopology.java (original)
+++ hadoop/core/trunk/src/core/org/apache/hadoop/net/NetworkTopology.java Mon Jun 23 10:50:16
2008
@@ -184,7 +184,7 @@
       if (!isAncestor(n))
         throw new IllegalArgumentException(n.getName()
                                            +", which is located at "
-                                           +parent+", is not a decendent of "+currentPath);
+                                           +parent+", is not a descendent of "+currentPath);
       if (isParent(n)) {
         // this node is the parent of n; remove n directly
         for(int i=0; i<children.size(); i++) {
@@ -344,6 +344,11 @@
    */ 
   public void remove(Node node) {
     if (node==null) return;
+    if (NetworkTopology.UNRESOLVED.equals(node.getNetworkLocation())) {
+      // the node's network location has not resolved yet; 
+      // so it is not in the network topology
+      return;  
+    }
     if( node instanceof InnerNode ) {
       throw new IllegalArgumentException(
         "Not allow to remove an inner node: "+NodeBase.getPath(node));



Mime
View raw message