hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sur...@apache.org
Subject svn commit: r1424737 - in /hadoop/common/branches/branch-1-win: ./ src/hdfs/ src/hdfs/org/apache/hadoop/hdfs/ src/hdfs/org/apache/hadoop/hdfs/server/namenode/ src/test/org/apache/hadoop/hdfs/
Date Thu, 20 Dec 2012 22:32:23 GMT
Author: suresh
Date: Thu Dec 20 22:32:23 2012
New Revision: 1424737

URL: http://svn.apache.org/viewvc?rev=1424737&view=rev
Log:
HDFS-4320. Merge 1424734 from branch-1

Modified:
    hadoop/common/branches/branch-1-win/CHANGES.branch-1-win.txt
    hadoop/common/branches/branch-1-win/src/hdfs/hdfs-default.xml
    hadoop/common/branches/branch-1-win/src/hdfs/org/apache/hadoop/hdfs/DFSConfigKeys.java
    hadoop/common/branches/branch-1-win/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNode.java
    hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/hdfs/TestDefaultNameNodePort.java

Modified: hadoop/common/branches/branch-1-win/CHANGES.branch-1-win.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/CHANGES.branch-1-win.txt?rev=1424737&r1=1424736&r2=1424737&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/CHANGES.branch-1-win.txt (original)
+++ hadoop/common/branches/branch-1-win/CHANGES.branch-1-win.txt Thu Dec 20 22:32:23 2012
@@ -299,3 +299,6 @@ Branch-hadoop-1-win (branched from branc
     HDFS-3942. Backport HDFS-3495 and HDFS-4234: Update Balancer to support new
     NetworkTopology with NodeGroup and use generic code for choosing datanode
     in Balancer.  (Junping Du via szetszwo)
+
+    HDFS-4320. Add a separate configuration for namenode rpc address instead
+    of using fs.default.name. (Mostafa Elhemali via suresh)

Modified: hadoop/common/branches/branch-1-win/src/hdfs/hdfs-default.xml
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/hdfs/hdfs-default.xml?rev=1424737&r1=1424736&r2=1424737&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/src/hdfs/hdfs-default.xml (original)
+++ hadoop/common/branches/branch-1-win/src/hdfs/hdfs-default.xml Thu Dec 20 22:32:23 2012
@@ -16,6 +16,16 @@ creations/deletions), or "all".</descrip
 </property>
 
 <property>
+  <name>dfs.namenode.rpc-address</name>
+  <value></value>
+  <description>
+    RPC address that handles all clients requests. If empty then we'll get the
+    value from fs.default.name.
+    The value of this property will take the form of hdfs://nn-host1:rpc-port.
+  </description>
+</property>
+
+<property>
   <name>dfs.secondary.http.address</name>
   <value>0.0.0.0:50090</value>
   <description>

Modified: hadoop/common/branches/branch-1-win/src/hdfs/org/apache/hadoop/hdfs/DFSConfigKeys.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/hdfs/org/apache/hadoop/hdfs/DFSConfigKeys.java?rev=1424737&r1=1424736&r2=1424737&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/src/hdfs/org/apache/hadoop/hdfs/DFSConfigKeys.java
(original)
+++ hadoop/common/branches/branch-1-win/src/hdfs/org/apache/hadoop/hdfs/DFSConfigKeys.java
Thu Dec 20 22:32:23 2012
@@ -50,6 +50,7 @@ public class DFSConfigKeys extends Commo
   public static final int     DFS_NAMENODE_HTTP_PORT_DEFAULT = 50070;
   public static final String  DFS_NAMENODE_HTTP_ADDRESS_KEY = "dfs.namenode.http-address";
   public static final String  DFS_NAMENODE_HTTP_ADDRESS_DEFAULT = "0.0.0.0:" + DFS_NAMENODE_HTTP_PORT_DEFAULT;
+  public static final String  DFS_NAMENODE_RPC_ADDRESS_KEY = "dfs.namenode.rpc-address";
   public static final String  DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY = "dfs.namenode.servicerpc-address";
   public static final String  DFS_NAMENODE_MAX_OBJECTS_KEY = "dfs.namenode.max.objects";
   public static final long    DFS_NAMENODE_MAX_OBJECTS_DEFAULT = 0;

Modified: hadoop/common/branches/branch-1-win/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNode.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNode.java?rev=1424737&r1=1424736&r2=1424737&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNode.java
(original)
+++ hadoop/common/branches/branch-1-win/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNode.java
Thu Dec 20 22:32:23 2012
@@ -225,7 +225,11 @@ public class NameNode implements ClientP
   }
 
   public static InetSocketAddress getAddress(Configuration conf) {
-    return getAddress(FileSystem.getDefaultUri(conf).toString());
+    String addr = conf.get(DFSConfigKeys.DFS_NAMENODE_RPC_ADDRESS_KEY);
+    if (addr == null || addr.isEmpty()) {
+      return getAddress(FileSystem.getDefaultUri(conf).toString());
+    }
+    return getAddress(addr);
   }
 
   public static URI getUri(InetSocketAddress namenode) {

Modified: hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/hdfs/TestDefaultNameNodePort.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/hdfs/TestDefaultNameNodePort.java?rev=1424737&r1=1424736&r2=1424737&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/hdfs/TestDefaultNameNodePort.java
(original)
+++ hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/hdfs/TestDefaultNameNodePort.java
Thu Dec 20 22:32:23 2012
@@ -51,6 +51,11 @@ public class TestDefaultNameNodePort {
     assertEquals(NameNode.getAddress(conf).getPort(), 555);
     FileSystem.setDefaultUri(conf, "foo");
     assertEquals(NameNode.getAddress(conf).getPort(), NameNode.DEFAULT_PORT);
+    conf.set(DFSConfigKeys.DFS_NAMENODE_RPC_ADDRESS_KEY, "hdfs://bar:222");
+    assertEquals("bar", NameNode.getAddress(conf).getHostName());
+    assertEquals(222, NameNode.getAddress(conf).getPort());
+    conf.set(DFSConfigKeys.DFS_NAMENODE_RPC_ADDRESS_KEY, "");
+    assertEquals(NameNode.getAddress(conf).getPort(), NameNode.DEFAULT_PORT);
   }
 
   public void testGetUri() {



Mime
View raw message