Author: hairong
Date: Mon Jun 23 10:59:17 2008
New Revision: 670688
URL: http://svn.apache.org/viewvc?rev=670688&view=rev
Log:
Merge -r 670685:670686 to move the change to main by HADOOP-3537 into release
0.18.0.
Modified:
hadoop/core/branches/branch-0.18/CHANGES.txt
hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/net/NetworkTopology.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=670688&r1=670687&r2=670688&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.18/CHANGES.txt Mon Jun 23 10:59:17 2008
@@ -687,6 +687,9 @@
HADOOP-1979. Speed up fsck by adding a buffered stream. (Lohit
Vijaya Renu via omalley)
+ 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/branches/branch-0.18/src/core/org/apache/hadoop/net/NetworkTopology.java
URL:
http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/net/NetworkTopology.java?rev=670688&r1=670687&r2=670688&view=diff
==============================================================================
---
hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/net/NetworkTopology.java
(original)
+++
hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/net/NetworkTopology.java
Mon Jun 23 10:59:17 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));