Permalink
Browse files

Closes OOZIE-9 (Apache) Launcher job should be able to run in differe…

…nt queue than job itself
  • Loading branch information...
1 parent 66d6fec commit 2670d1e945af42c2d3afa1f1436d5b5437aad886 Alejandro Abdelnur committed with Mohammad Kamrul Islam Aug 18, 2011
@@ -378,10 +378,13 @@ protected String getLauncherMain(Configuration launcherConf, Element actionXml)
return e.getTextTrim();
}
+ private static final String QUEUE_NAME = "mapred.job.queue.name";
+ private static final String OOZIE_LAUNCHER_QUEUE_NAME = "oozie.launcher.mapred.job.queue.name";
+
private static final Set<String> SPECIAL_PROPERTIES = new HashSet<String>();
static {
- SPECIAL_PROPERTIES.add("mapred.job.queue.name");
+ SPECIAL_PROPERTIES.add(QUEUE_NAME);
SPECIAL_PROPERTIES.add("mapreduce.jobtracker.kerberos.principal");
SPECIAL_PROPERTIES.add("dfs.namenode.kerberos.principal");
}
@@ -444,7 +447,10 @@ JobConf createLauncherConf(FileSystem actionFs, Context context, WorkflowAction
for (String name : SPECIAL_PROPERTIES) {
String value = actionConf.get(name);
if (value != null) {
- launcherJobConf.set(name, value);
+ if (!name.equals(QUEUE_NAME) ||
+ (name.equals(QUEUE_NAME) && launcherJobConf.get(OOZIE_LAUNCHER_QUEUE_NAME) == null)) {
+ launcherJobConf.set(name, value);
+ }
}
}
@@ -248,6 +248,40 @@ public void testSetupMethods() throws Exception {
assertTrue(getFileSystem().exists(new Path(context.getActionDir(), LauncherMapper.ACTION_CONF_XML)));
+ actionXml = XmlUtils.parseXml("<java>" + "<job-tracker>" + getJobTrackerUri() + "</job-tracker>" +
+ "<name-node>" + getNameNodeUri() + "</name-node> <configuration>" +
+ "<property><name>mapred.job.queue.name</name><value>AQ</value></property>" +
+ "</configuration>" + "<main-class>MAIN-CLASS</main-class>" +
+ "</java>");
+ actionConf = ae.createBaseHadoopConf(context, actionXml);
+ ae.setupActionConf(actionConf, context, actionXml, appPath);
+ conf = ae.createLauncherConf(getFileSystem(), context, action, actionXml, actionConf);
+ assertEquals("AQ", conf.get("mapred.job.queue.name"));
+ assertEquals("AQ", actionConf.get("mapred.job.queue.name"));
+
+ actionXml = XmlUtils.parseXml("<java>" + "<job-tracker>" + getJobTrackerUri() + "</job-tracker>" +
+ "<name-node>" + getNameNodeUri() + "</name-node> <configuration>" +
+ "<property><name>oozie.launcher.mapred.job.queue.name</name><value>LQ</value></property>" +
+ "</configuration>" + "<main-class>MAIN-CLASS</main-class>" +
+ "</java>");
+ actionConf = ae.createBaseHadoopConf(context, actionXml);
+ ae.setupActionConf(actionConf, context, actionXml, appPath);
+ conf = ae.createLauncherConf(getFileSystem(), context, action, actionXml, actionConf);
+ assertEquals("LQ", conf.get("mapred.job.queue.name"));
+
+ actionXml = XmlUtils.parseXml("<java>" + "<job-tracker>" + getJobTrackerUri() + "</job-tracker>" +
+ "<name-node>" + getNameNodeUri() + "</name-node> <configuration>" +
+ "<property><name>oozie.launcher.mapred.job.queue.name</name><value>LQ</value></property>" +
+ "<property><name>mapred.job.queue.name</name><value>AQ</value></property>" +
+ "</configuration>" + "<main-class>MAIN-CLASS</main-class>" +
+ "</java>");
+ actionConf = ae.createBaseHadoopConf(context, actionXml);
+ ae.setupActionConf(actionConf, context, actionXml, appPath);
+ conf = ae.createLauncherConf(getFileSystem(), context, action, actionXml, actionConf);
+ assertEquals("LQ", conf.get("mapred.job.queue.name"));
+ assertEquals("AQ", actionConf.get("mapred.job.queue.name"));
+
+
}
protected Context createContext(String actionXml) throws Exception {
View
@@ -1,5 +1,6 @@
-- Oozie 3.1.0 release
+OOZIE-9 (Apache) Launcher job should be able to run in different queue than job itself
OOZIE-20 add sql scripts for oozie 3.1.0
OOZIE-135 support multiple shared lib path in oozie
OOZIE-18 Option to view Workflow job details from Coordinator job detail popup

0 comments on commit 2670d1e

Please sign in to comment.