hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r513976 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/dfs/FSNamesystem.java src/java/org/apache/hadoop/dfs/NameNode.java
Date Fri, 02 Mar 2007 21:57:33 GMT
Author: cutting
Date: Fri Mar  2 13:57:33 2007
New Revision: 513976

URL: http://svn.apache.org/viewvc?view=rev&rev=513976
Log:
HADOOP-1056.  Check HDFS include/exclude node lists with both IP address and hostname.  Contributed
by Wendy.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NameNode.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=513976&r1=513975&r2=513976
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Fri Mar  2 13:57:33 2007
@@ -192,6 +192,9 @@
 58. HADOOP-1049.  Fix a race condition in IPC client.
     (Devaraj Das via cutting)
 
+60. HADOOP-1056.  Check HDFS include/exclude node lists with both IP
+    address and hostname.  (Wendy Chien via cutting)
+
 
 Release 0.11.2 - 2007-02-16
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java?view=diff&rev=513976&r1=513975&r2=513976
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java Fri Mar  2 13:57:33
2007
@@ -1473,6 +1473,10 @@
                                                String networkLocation
                                               ) throws IOException {
 
+      if (!verifyNodeRegistration(nodeReg)) {
+        throw new DisallowedDatanodeException( nodeReg );
+      }
+
       String dnAddress = Server.getRemoteAddress();
       if ( dnAddress == null ) {
         //Mostly not called inside an RPC.
@@ -3157,14 +3161,18 @@
       Set<String> hostsList = hostsReader.getHosts();
       return (hostsList.isEmpty() || 
               hostsList.contains(node.getName()) || 
-              hostsList.contains(node.getHost()));
+              hostsList.contains(node.getHost()) ||
+              ((node instanceof DatanodeInfo) && 
+               hostsList.contains(((DatanodeInfo)node).getHostName())));
     }
 
 
     private boolean inExcludedHostsList(DatanodeID node) {
       Set<String> excludeList = hostsReader.getExcludedHosts();
       return (excludeList.contains(node.getName()) ||
-              excludeList.contains(node.getHost()));
+              excludeList.contains(node.getHost()) ||
+              ((node instanceof DatanodeInfo) && 
+               excludeList.contains(((DatanodeInfo)node).getHostName())));
     }
 
     /**

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NameNode.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NameNode.java?view=diff&rev=513976&r1=513975&r2=513976
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NameNode.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NameNode.java Fri Mar  2 13:57:33 2007
@@ -559,9 +559,6 @@
     public DatanodeRegistration register( DatanodeRegistration nodeReg,
                                           String networkLocation
                                         ) throws IOException {
-      if (!namesystem.verifyNodeRegistration(nodeReg)) {
-        throw new DisallowedDatanodeException( nodeReg );
-      }
       verifyVersion( nodeReg.getVersion() );
       namesystem.registerDatanode( nodeReg, networkLocation );
       



Mime
View raw message