Skip to content
This repository has been archived by the owner on Jan 6, 2018. It is now read-only.

Commit

Permalink
Closes OOZIE-9 (Apache) Launcher job should be able to run in differe…
Browse files Browse the repository at this point in the history
…nt queue than job itself
  • Loading branch information
Alejandro Abdelnur authored and Mohammad Kamrul Islam committed Aug 22, 2011
1 parent 66d6fec commit 2670d1e
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
Expand Up @@ -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");
}
Expand Down Expand Up @@ -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);
}
}
}

Expand Down
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions release-log.txt
@@ -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
Expand Down

0 comments on commit 2670d1e

Please sign in to comment.