hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss...@apache.org
Subject svn commit: r1417677 - in /hadoop/common/branches/branch-1: ./ src/contrib/fairscheduler/src/test/org/apache/hadoop/mapred/ src/mapred/org/apache/hadoop/mapred/ src/test/org/apache/hadoop/mapred/
Date Wed, 05 Dec 2012 22:30:24 GMT
Author: sseth
Date: Wed Dec  5 22:30:23 2012
New Revision: 1417677

URL: http://svn.apache.org/viewvc?rev=1417677&view=rev
Log:
MAPREDUCE-4699. Fixed unit test failures - TestFairScheduler and TestCapacityScheduler. (Contributed
by Gopal V)

Modified:
    hadoop/common/branches/branch-1/CHANGES.txt
    hadoop/common/branches/branch-1/src/contrib/fairscheduler/src/test/org/apache/hadoop/mapred/TestFairScheduler.java
    hadoop/common/branches/branch-1/src/mapred/org/apache/hadoop/mapred/JobTracker.java
    hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/UtilsForTests.java

Modified: hadoop/common/branches/branch-1/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/CHANGES.txt?rev=1417677&r1=1417676&r2=1417677&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1/CHANGES.txt Wed Dec  5 22:30:23 2012
@@ -360,6 +360,9 @@ Release 1.1.2 - Unreleased
     MAPREDUCE-4697. Fixed a failing unit test - TestMapredHeartbeat.
     (Gopal V via sseth)
 
+    MAPREDUCE-4699. Fixed unit test failures - TestFairScheduler and 
+    TestCapacityScheduler. (Gopal V via sseth)
+
 Release 1.1.1 - 2012.11.18
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-1/src/contrib/fairscheduler/src/test/org/apache/hadoop/mapred/TestFairScheduler.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/contrib/fairscheduler/src/test/org/apache/hadoop/mapred/TestFairScheduler.java?rev=1417677&r1=1417676&r2=1417677&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/src/contrib/fairscheduler/src/test/org/apache/hadoop/mapred/TestFairScheduler.java
(original)
+++ hadoop/common/branches/branch-1/src/contrib/fairscheduler/src/test/org/apache/hadoop/mapred/TestFairScheduler.java
Wed Dec  5 22:30:23 2012
@@ -559,6 +559,10 @@ public class TestFairScheduler extends T
     clock = new FakeClock();
     try {
       jobTracker = new JobTracker(conf, clock);
+      jobTracker.setSafeModeInternal(JobTracker.SafeModeAction.SAFEMODE_ENTER);
+      jobTracker.initializeFilesystem();
+      jobTracker.setSafeModeInternal(JobTracker.SafeModeAction.SAFEMODE_LEAVE);
+      jobTracker.initialize();
     } catch (Exception e) {
       throw new RuntimeException("Could not start JT", e);
     }

Modified: hadoop/common/branches/branch-1/src/mapred/org/apache/hadoop/mapred/JobTracker.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/mapred/org/apache/hadoop/mapred/JobTracker.java?rev=1417677&r1=1417676&r2=1417677&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/src/mapred/org/apache/hadoop/mapred/JobTracker.java (original)
+++ hadoop/common/branches/branch-1/src/mapred/org/apache/hadoop/mapred/JobTracker.java Wed
Dec  5 22:30:23 2012
@@ -54,6 +54,7 @@ import java.util.concurrent.atomic.Atomi
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.fs.FSDataInputStream;
 import org.apache.hadoop.fs.FSDataOutputStream;
 import org.apache.hadoop.fs.FileStatus;
@@ -1899,8 +1900,9 @@ public class JobTracker implements MRCon
       conf.setBoolean(DFSConfigKeys.DFS_CLIENT_RETRY_POLICY_ENABLED_KEY, false);
     }
   }
-  
-  private void initializeFilesystem() throws IOException, InterruptedException {
+ 
+  @InterfaceAudience.Private
+  void initializeFilesystem() throws IOException, InterruptedException {
     // Connect to HDFS NameNode
     while (!Thread.currentThread().isInterrupted() && fs == null) {
       try {
@@ -1928,7 +1930,8 @@ public class JobTracker implements MRCon
     }
   }
   
-  private void initialize() 
+  @InterfaceAudience.Private
+  void initialize() 
       throws IOException, InterruptedException {
     // initialize history parameters.
     final JobTracker jtFinal = this;

Modified: hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/UtilsForTests.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/UtilsForTests.java?rev=1417677&r1=1417676&r2=1417677&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/UtilsForTests.java (original)
+++ hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/UtilsForTests.java Wed
Dec  5 22:30:23 2012
@@ -843,6 +843,10 @@ public class UtilsForTests {
     JobConf conf = new JobConf();
     conf.set("mapred.job.tracker", "localhost:0");
     conf.set("mapred.job.tracker.http.address", "0.0.0.0:0");
+    return getJobTracker(conf, qm);
+  }
+
+  static JobTracker getJobTracker(JobConf conf, QueueManager qm) {
     JobTracker jt;
     try {
       if (qm == null) {
@@ -850,6 +854,10 @@ public class UtilsForTests {
       } else {
         jt = new JobTracker(conf, qm);
       }
+      jt.setSafeModeInternal(JobTracker.SafeModeAction.SAFEMODE_ENTER);
+      jt.initializeFilesystem();
+      jt.setSafeModeInternal(JobTracker.SafeModeAction.SAFEMODE_LEAVE);
+      jt.initialize();
       return jt;
     } catch (Exception e) {
       throw new RuntimeException("Could not start jt", e);



Mime
View raw message