瀏覽代碼

HADOOP-3060. Removes one unused constructor argument from MiniMRCluster. Contributed by Amareshwari Sriramadasu.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@641807 13f79535-47bb-0310-9956-ffa450edef68
Devaraj Das 17 年之前
父節點
當前提交
0197173e25

+ 3 - 0
CHANGES.txt

@@ -56,6 +56,9 @@ Trunk (unreleased changes)
     org.apache.hadoop.record.compiler.generated.SimpleCharStream. 
     org.apache.hadoop.record.compiler.generated.SimpleCharStream. 
     (Amareshwari Sriramadasu via ddas)
     (Amareshwari Sriramadasu via ddas)
 
 
+    HADOOP-3060. Removes one unused constructor argument from MiniMRCluster.
+    (Amareshwari Sriramadasu via ddas)
+
   NEW FEATURES
   NEW FEATURES
 
 
     HADOOP-1398.  Add HBase in-memory block cache.  (tomwhite)
     HADOOP-1398.  Add HBase in-memory block cache.  (tomwhite)

+ 11 - 19
src/test/org/apache/hadoop/mapred/MiniMRCluster.java

@@ -270,7 +270,7 @@ public class MiniMRCluster {
    */
    */
   public MiniMRCluster(int numTaskTrackers, String namenode, int numDir, 
   public MiniMRCluster(int numTaskTrackers, String namenode, int numDir, 
       String[] racks, String[] hosts) throws IOException {
       String[] racks, String[] hosts) throws IOException {
-    this(0, 0, numTaskTrackers, namenode, false, numDir, racks, hosts);
+    this(0, 0, numTaskTrackers, namenode, numDir, racks, hosts);
   }
   }
   
   
   /**
   /**
@@ -282,41 +282,41 @@ public class MiniMRCluster {
    */
    */
   public MiniMRCluster(int numTaskTrackers, String namenode, int numDir) 
   public MiniMRCluster(int numTaskTrackers, String namenode, int numDir) 
     throws IOException {
     throws IOException {
-    this(0, 0, numTaskTrackers, namenode, false, numDir);
+    this(0, 0, numTaskTrackers, namenode, numDir);
   }
   }
     
     
   public MiniMRCluster(int jobTrackerPort,
   public MiniMRCluster(int jobTrackerPort,
       int taskTrackerPort,
       int taskTrackerPort,
       int numTaskTrackers,
       int numTaskTrackers,
       String namenode,
       String namenode,
-      boolean taskTrackerFirst, int numDir)
+      int numDir)
   throws IOException {
   throws IOException {
     this(jobTrackerPort, taskTrackerPort, numTaskTrackers, namenode, 
     this(jobTrackerPort, taskTrackerPort, numTaskTrackers, namenode, 
-        taskTrackerFirst, numDir, null);
+         numDir, null);
   }
   }
   
   
   public MiniMRCluster(int jobTrackerPort,
   public MiniMRCluster(int jobTrackerPort,
       int taskTrackerPort,
       int taskTrackerPort,
       int numTaskTrackers,
       int numTaskTrackers,
       String namenode,
       String namenode,
-      boolean taskTrackerFirst, int numDir,
+      int numDir,
       String[] racks) throws IOException {
       String[] racks) throws IOException {
     this(jobTrackerPort, taskTrackerPort, numTaskTrackers, namenode, 
     this(jobTrackerPort, taskTrackerPort, numTaskTrackers, namenode, 
-        taskTrackerFirst, numDir, racks, null);
+         numDir, racks, null);
   }
   }
   
   
   public MiniMRCluster(int jobTrackerPort,
   public MiniMRCluster(int jobTrackerPort,
                        int taskTrackerPort,
                        int taskTrackerPort,
                        int numTaskTrackers,
                        int numTaskTrackers,
                        String namenode,
                        String namenode,
-                       boolean taskTrackerFirst, int numDir,
+                       int numDir,
                        String[] racks, String[] hosts) throws IOException {
                        String[] racks, String[] hosts) throws IOException {
     this(jobTrackerPort, taskTrackerPort, numTaskTrackers, namenode, 
     this(jobTrackerPort, taskTrackerPort, numTaskTrackers, namenode, 
-        taskTrackerFirst, numDir, racks, hosts, null);
+         numDir, racks, hosts, null);
   }
   }
 
 
   public MiniMRCluster(int jobTrackerPort, int taskTrackerPort,
   public MiniMRCluster(int jobTrackerPort, int taskTrackerPort,
-      int numTaskTrackers, String namenode, boolean taskTrackerFirst,
+      int numTaskTrackers, String namenode, 
       int numDir, String[] racks, String[] hosts, UnixUserGroupInformation ugi
       int numDir, String[] racks, String[] hosts, UnixUserGroupInformation ugi
       ) throws IOException {
       ) throws IOException {
     if (racks != null && racks.length < numTaskTrackers) {
     if (racks != null && racks.length < numTaskTrackers) {
@@ -379,16 +379,8 @@ public class MiniMRCluster {
 
 
     // Start the MiniMRCluster
     // Start the MiniMRCluster
         
         
-    if (taskTrackerFirst) {
-      for (Thread taskTrackerThread : taskTrackerThreadList){
-        taskTrackerThread.start();
-      }
-    }
-        
-    if (!taskTrackerFirst) {
-      for (Thread taskTrackerThread : taskTrackerThreadList){
-        taskTrackerThread.start();
-      }
+    for (Thread taskTrackerThread : taskTrackerThreadList){
+      taskTrackerThread.start();
     }
     }
 
 
     // Wait till the MR cluster stabilizes
     // Wait till the MR cluster stabilizes

+ 2 - 2
src/test/org/apache/hadoop/mapred/TestMiniMRWithDFSWithDistinctUsers.java

@@ -72,7 +72,7 @@ public class TestMiniMRWithDFSWithDistinctUsers extends TestCase {
       UnixUserGroupInformation MR_UGI = createUGI(
       UnixUserGroupInformation MR_UGI = createUGI(
           UnixUserGroupInformation.login().getUserName(), true); 
           UnixUserGroupInformation.login().getUserName(), true); 
       mr = new MiniMRCluster(0, 0, 4, dfs.getFileSystem().getUri().toString(),
       mr = new MiniMRCluster(0, 0, 4, dfs.getFileSystem().getUri().toString(),
-          false, 1, null, null, MR_UGI);
+           1, null, null, MR_UGI);
 
 
       JobConf pi = createJobConf(mr, PI_UGI);
       JobConf pi = createJobConf(mr, PI_UGI);
       TestMiniMRWithDFS.runPI(mr, pi);
       TestMiniMRWithDFS.runPI(mr, pi);
@@ -84,4 +84,4 @@ public class TestMiniMRWithDFSWithDistinctUsers extends TestCase {
       if (mr != null) { mr.shutdown();}
       if (mr != null) { mr.shutdown();}
     }
     }
   }
   }
-}
+}