Repository: oozie Updated Branches: refs/heads/oya 8d5f9a76b -> 40ee3200f
inject config-class only in MRActionExecutor Change-Id: I441994732d15172cbf3681fa98189e4ecac24872 Project: http://git-wip-us.apache.org/repos/asf/oozie/repo Commit: http://git-wip-us.apache.org/repos/asf/oozie/commit/2f99ad1f Tree: http://git-wip-us.apache.org/repos/asf/oozie/tree/2f99ad1f Diff: http://git-wip-us.apache.org/repos/asf/oozie/diff/2f99ad1f Branch: refs/heads/oya Commit: 2f99ad1f075e267e2fee7e44d1fd2b3fa8ffb636 Parents: e8e5bd0 Author: Gezapeti Cseh <gezap...@gmail.com> Authored: Tue May 9 18:40:17 2017 -0700 Committer: Gezapeti Cseh <gezap...@gmail.com> Committed: Tue May 9 18:44:39 2017 -0700 ---------------------------------------------------------------------- .../oozie/action/hadoop/JavaActionExecutor.java | 12 +----------- .../action/hadoop/MapReduceActionExecutor.java | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/oozie/blob/2f99ad1f/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java b/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java index 45a43bf..1e686c0 100644 --- a/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java +++ b/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java @@ -238,6 +238,7 @@ public class JavaActionExecutor extends ActionExecutor { } protected Configuration createBaseHadoopConf(Context context, Element actionXml, boolean loadResources) { + Namespace ns = actionXml.getNamespace(); String jobTracker = actionXml.getChild("job-tracker", ns).getTextTrim(); String nameNode = actionXml.getChild("name-node", ns).getTextTrim(); @@ -254,12 +255,6 @@ public class JavaActionExecutor extends ActionExecutor { conf.set(HADOOP_NAME_NODE, nameNode); conf.set("mapreduce.fileoutputcommitter.marksuccessfuljobs", "true"); - // FIXME - think about this! - Element e = actionXml.getChild("config-class", ns); - if (e != null) { - conf.set(LauncherMapper.OOZIE_ACTION_CONFIG_CLASS, e.getTextTrim()); - } - return conf; } @@ -300,11 +295,6 @@ public class JavaActionExecutor extends ActionExecutor { } XConfiguration.copy(launcherConf, conf); checkForDisallowedProps(launcherConf, "launcher configuration"); - // Inject config-class for launcher to use for action - Element e = actionXml.getChild("config-class", ns); - if (e != null) { - conf.set(LauncherMapper.OOZIE_ACTION_CONFIG_CLASS, e.getTextTrim()); - } return conf; } catch (IOException ex) { http://git-wip-us.apache.org/repos/asf/oozie/blob/2f99ad1f/core/src/main/java/org/apache/oozie/action/hadoop/MapReduceActionExecutor.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/action/hadoop/MapReduceActionExecutor.java b/core/src/main/java/org/apache/oozie/action/hadoop/MapReduceActionExecutor.java index dfe19d1..bbc0e89 100644 --- a/core/src/main/java/org/apache/oozie/action/hadoop/MapReduceActionExecutor.java +++ b/core/src/main/java/org/apache/oozie/action/hadoop/MapReduceActionExecutor.java @@ -117,6 +117,23 @@ public class MapReduceActionExecutor extends JavaActionExecutor { throws ActionExecutorException { super.setupLauncherConf(conf, actionXml, appPath, context); conf.setBoolean("mapreduce.job.complete.cancel.delegation.tokens", false); + injectConfigClass(conf, actionXml); + + return conf; + } + + private void injectConfigClass(Configuration conf, Element actionXml) { + // Inject config-class for launcher to use for action + Element e = actionXml.getChild("config-class", actionXml.getNamespace()); + if (e != null) { + conf.set(LauncherMapper.OOZIE_ACTION_CONFIG_CLASS, e.getTextTrim()); + } + } + + @Override + protected Configuration createBaseHadoopConf(Context context, Element actionXml, boolean loadResources) { + Configuration conf = super.createBaseHadoopConf(context, actionXml, loadResources); + injectConfigClass(conf, actionXml); return conf; }