hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szets...@apache.org
Subject svn commit: r1062283 - in /hadoop/mapreduce/branches/branch-0.22: CHANGES.txt src/test/mapred/org/apache/hadoop/mapred/TestMRServerPorts.java
Date Sat, 22 Jan 2011 22:06:06 GMT
Author: szetszwo
Date: Sat Jan 22 22:06:06 2011
New Revision: 1062283

URL: http://svn.apache.org/viewvc?rev=1062283&view=rev
Log:
MAPREDUCE-2282. Fix TestMRServerPorts for the changes in TestHDFSServerPorts.  Contributed
by shv

Modified:
    hadoop/mapreduce/branches/branch-0.22/CHANGES.txt
    hadoop/mapreduce/branches/branch-0.22/src/test/mapred/org/apache/hadoop/mapred/TestMRServerPorts.java

Modified: hadoop/mapreduce/branches/branch-0.22/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.22/CHANGES.txt?rev=1062283&r1=1062282&r2=1062283&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.22/CHANGES.txt (original)
+++ hadoop/mapreduce/branches/branch-0.22/CHANGES.txt Sat Jan 22 22:06:06 2011
@@ -427,6 +427,9 @@ Release 0.22.0 - Unreleased
     MAPREDUCE-1085. For tasks, "ulimit -v -1" is being run when user doesn't
     specify a ulimit (todd)
 
+    MAPREDUCE-2282. Fix TestMRServerPorts for the changes in
+    TestHDFSServerPorts.  (shv via szetszwo)
+
 Release 0.21.1 - Unreleased
 
   NEW FEATURES

Modified: hadoop/mapreduce/branches/branch-0.22/src/test/mapred/org/apache/hadoop/mapred/TestMRServerPorts.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.22/src/test/mapred/org/apache/hadoop/mapred/TestMRServerPorts.java?rev=1062283&r1=1062282&r2=1062283&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.22/src/test/mapred/org/apache/hadoop/mapred/TestMRServerPorts.java
(original)
+++ hadoop/mapreduce/branches/branch-0.22/src/test/mapred/org/apache/hadoop/mapred/TestMRServerPorts.java
Sat Jan 22 22:06:06 2011
@@ -41,6 +41,8 @@ import org.apache.hadoop.fs.FileSystem;
  * a free port and start on it.
  */
 public class TestMRServerPorts extends TestCase {
+  static final String THIS_HOST = TestHDFSServerPorts.getFullHostName() + ":0";
+
   TestHDFSServerPorts hdfs = new TestHDFSServerPorts();
 
   // Runs the JT in a separate thread
@@ -80,12 +82,9 @@ public class TestMRServerPorts extends T
   }
   
   private void setDataNodePorts(Configuration conf) {
-    conf.set("dfs.datanode.address", 
-        TestHDFSServerPorts.NAME_NODE_HOST + "0");
-    conf.set("dfs.datanode.http.address", 
-        TestHDFSServerPorts.NAME_NODE_HTTP_HOST + "0");
-    conf.set("dfs.datanode.ipc.address", 
-        TestHDFSServerPorts.NAME_NODE_HOST + "0");
+    conf.set("dfs.datanode.address", THIS_HOST);
+    conf.set("dfs.datanode.http.address", THIS_HOST);
+    conf.set("dfs.datanode.ipc.address", THIS_HOST);
   }
 
   /**
@@ -138,22 +137,20 @@ public class TestMRServerPorts extends T
       JobConf conf2 = new JobConf(hdfs.getConfig());
       conf2.set(JTConfig.JT_IPC_ADDRESS,
                 FileSystem.getDefaultUri(hdfs.getConfig()).toString());
-      conf2.set(JTConfig.JT_HTTP_ADDRESS,
-        TestHDFSServerPorts.NAME_NODE_HTTP_HOST + 0);
+      conf2.set(JTConfig.JT_HTTP_ADDRESS, THIS_HOST);
       boolean started = canStartJobTracker(conf2);
       assertFalse(started); // should fail
 
       // bind http server to the same port as name-node
-      conf2.set(JTConfig.JT_IPC_ADDRESS, TestHDFSServerPorts.NAME_NODE_HOST + 0);
+      conf2.set(JTConfig.JT_IPC_ADDRESS, THIS_HOST);
       conf2.set(JTConfig.JT_HTTP_ADDRESS,
         hdfs.getConfig().get("dfs.http.address"));
       started = canStartJobTracker(conf2);
       assertFalse(started); // should fail again
 
       // both ports are different from the name-node ones
-      conf2.set(JTConfig.JT_IPC_ADDRESS, TestHDFSServerPorts.NAME_NODE_HOST + 0);
-      conf2.set(JTConfig.JT_HTTP_ADDRESS,
-        TestHDFSServerPorts.NAME_NODE_HTTP_HOST + 0);
+      conf2.set(JTConfig.JT_IPC_ADDRESS, THIS_HOST);
+      conf2.set(JTConfig.JT_HTTP_ADDRESS, THIS_HOST);
       started = canStartJobTracker(conf2);
       assertTrue(started); // should start now
 
@@ -183,24 +180,20 @@ public class TestMRServerPorts extends T
       // start job tracker on the same port as name-node
       conf2.set(TTConfig.TT_REPORT_ADDRESS,
                 FileSystem.getDefaultUri(hdfs.getConfig()).toString());
-      conf2.set(TTConfig.TT_HTTP_ADDRESS,
-        TestHDFSServerPorts.NAME_NODE_HTTP_HOST + 0);
+      conf2.set(TTConfig.TT_HTTP_ADDRESS, THIS_HOST);
       boolean started = canStartTaskTracker(conf2);
       assertFalse(started); // should fail
 
       // bind http server to the same port as name-node
-      conf2.set(TTConfig.TT_REPORT_ADDRESS,
-        TestHDFSServerPorts.NAME_NODE_HOST + 0);
+      conf2.set(TTConfig.TT_REPORT_ADDRESS, THIS_HOST);
       conf2.set(TTConfig.TT_HTTP_ADDRESS,
         hdfs.getConfig().get("dfs.http.address"));
       started = canStartTaskTracker(conf2);
       assertFalse(started); // should fail again
 
       // both ports are different from the name-node ones
-      conf2.set(TTConfig.TT_REPORT_ADDRESS,
-        TestHDFSServerPorts.NAME_NODE_HOST + 0);
-      conf2.set(TTConfig.TT_HTTP_ADDRESS,
-        TestHDFSServerPorts.NAME_NODE_HTTP_HOST + 0);
+      conf2.set(TTConfig.TT_REPORT_ADDRESS, THIS_HOST);
+      conf2.set(TTConfig.TT_HTTP_ADDRESS, THIS_HOST);
       started = canStartTaskTracker(conf2);
       assertTrue(started); // should start now
     } finally {



Mime
View raw message