hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r1150528 - in /hadoop/common/branches/branch-0.20-security: ./ src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/ src/mapred/org/apache/hadoop/mapred/ src/test/org/apache/hadoop/mapred/
Date Mon, 25 Jul 2011 02:33:48 GMT
Author: mahadev
Date: Mon Jul 25 02:33:47 2011
New Revision: 1150528

URL: http://svn.apache.org/viewvc?rev=1150528&view=rev
Log:
MAPREDUCE-2621. TestCapacityScheduler fails with "Queue "q1" does not exist".

Modified:
    hadoop/common/branches/branch-0.20-security/CHANGES.txt
    hadoop/common/branches/branch-0.20-security/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/TestCapacityScheduler.java
    hadoop/common/branches/branch-0.20-security/src/mapred/org/apache/hadoop/mapred/JobTracker.java
    hadoop/common/branches/branch-0.20-security/src/test/org/apache/hadoop/mapred/UtilsForTests.java

Modified: hadoop/common/branches/branch-0.20-security/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security/CHANGES.txt?rev=1150528&r1=1150527&r2=1150528&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.20-security/CHANGES.txt Mon Jul 25 02:33:47 2011
@@ -26,6 +26,9 @@ Release 0.20.205.0 - unreleased
     HADOOP-7314. Add support for throwing UnknownHostException when a host
     doesn't resolve. Needed for MAPREDUCE-2489. (Jeffrey Naisbitt via mattf)
 
+    MAPREDUCE-2621. TestCapacityScheduler fails with "Queue "q1" does not exist".
+    (Sherry Chen via mahadev)
+
 Release 0.20.204.0 - unreleased
 
   NEW FEATURES

Modified: hadoop/common/branches/branch-0.20-security/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/TestCapacityScheduler.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/TestCapacityScheduler.java?rev=1150528&r1=1150527&r2=1150528&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/TestCapacityScheduler.java
(original)
+++ hadoop/common/branches/branch-0.20-security/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/TestCapacityScheduler.java
Mon Jul 25 02:33:47 2011
@@ -794,7 +794,7 @@ public class TestCapacityScheduler exten
     FakeJobInProgress job =
         new FakeJobInProgress(new JobID("test", ++jobCounter),
             (jobConf == null ? new JobConf(conf) : jobConf), taskTrackerManager,
-            jobConf.getUser(), UtilsForTests.getJobTracker());
+            jobConf.getUser(), UtilsForTests.getJobTracker(taskTrackerManager.getQueueManager()));
     job.getStatus().setRunState(state);
     taskTrackerManager.submitJob(job);
     return job;

Modified: hadoop/common/branches/branch-0.20-security/src/mapred/org/apache/hadoop/mapred/JobTracker.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security/src/mapred/org/apache/hadoop/mapred/JobTracker.java?rev=1150528&r1=1150527&r2=1150528&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security/src/mapred/org/apache/hadoop/mapred/JobTracker.java
(original)
+++ hadoop/common/branches/branch-0.20-security/src/mapred/org/apache/hadoop/mapred/JobTracker.java
Mon Jul 25 02:33:47 2011
@@ -2165,6 +2165,11 @@ public class JobTracker implements MRCon
     this(conf, generateNewIdentifier());
   }
 
+  JobTracker(JobConf conf, QueueManager qm) 
+  throws IOException, InterruptedException {
+    this(conf, generateNewIdentifier(), new Clock(), qm);
+  }
+
   JobTracker(JobConf conf, Clock clock) 
   throws IOException, InterruptedException {
     this(conf, generateNewIdentifier(), clock);
@@ -2178,9 +2183,16 @@ public class JobTracker implements MRCon
   throws IOException, InterruptedException {   
     this(conf, identifier, new Clock());
   }
-  
+
   JobTracker(final JobConf conf, String identifier, Clock clock) 
   throws IOException, InterruptedException { 
+
+    this(conf, identifier, clock, new QueueManager(new Configuration(conf)));
+  } 
+  
+  JobTracker(final JobConf conf, String identifier, Clock clock, QueueManager qm) 
+  throws IOException, InterruptedException { 
+    this.queueManager = qm;
     this.clock = clock;
     // Set ports, start RPC servers, setup security policy etc.
     InetSocketAddress addr = getAddress(conf);
@@ -2271,10 +2283,6 @@ public class JobTracker implements MRCon
     // Read the hosts/exclude files to restrict access to the jobtracker.
     this.hostsReader = new HostsFileReader(conf.get("mapred.hosts", ""),
                                            conf.get("mapred.hosts.exclude", ""));
-
-    Configuration queuesConf = new Configuration(this.conf);
-    queueManager = new QueueManager(queuesConf);
-
     aclsManager = new ACLsManager(conf, new JobACLsManager(conf), queueManager);
 
     LOG.info("Starting jobtracker with owner as " +

Modified: hadoop/common/branches/branch-0.20-security/src/test/org/apache/hadoop/mapred/UtilsForTests.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security/src/test/org/apache/hadoop/mapred/UtilsForTests.java?rev=1150528&r1=1150527&r2=1150528&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security/src/test/org/apache/hadoop/mapred/UtilsForTests.java
(original)
+++ hadoop/common/branches/branch-0.20-security/src/test/org/apache/hadoop/mapred/UtilsForTests.java
Mon Jul 25 02:33:47 2011
@@ -825,12 +825,20 @@ public class UtilsForTests {
   }
 
   static JobTracker getJobTracker() {
+    return(getJobTracker(null));
+  }
+
+  static JobTracker getJobTracker(QueueManager qm) {
     JobConf conf = new JobConf();
     conf.set("mapred.job.tracker", "localhost:0");
     conf.set("mapred.job.tracker.http.address", "0.0.0.0:0");
     JobTracker jt;
     try {
-      jt = new JobTracker(conf);
+      if (qm == null) {
+       jt = new JobTracker(conf);
+      } else {
+        jt = new JobTracker(conf, qm);
+      }
       return jt;
     } catch (Exception e) {
       throw new RuntimeException("Could not start jt", e);



Mime
View raw message