From 8bee566786d5051569efbb6ddf78680ffc96e60a Mon Sep 17 00:00:00 2001 From: Sunil G Date: Thu, 18 May 2017 22:49:42 +0530 Subject: [PATCH] YARN-6560. SLS doesn't honor node total resource specified in sls-runner.xml. Contributed by Wangda Tan. --- .../java/org/apache/hadoop/yarn/sls/SLSRunner.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/SLSRunner.java b/hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/SLSRunner.java index f66d2d0494c..e679c9de206 100644 --- a/hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/SLSRunner.java +++ b/hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/SLSRunner.java @@ -145,6 +145,16 @@ public class SLSRunner extends Configured implements Tool { init(tempConf); } + @Override + public void setConf(Configuration conf) { + if (null != conf) { + // Override setConf to make sure all conf added load sls-runner.xml, see + // YARN-6560 + conf.addResource("sls-runner.xml"); + } + super.setConf(conf); + } + private void init(Configuration tempConf) throws ClassNotFoundException { nmMap = new HashMap<>(); queueAppNumMap = new HashMap<>(); @@ -152,8 +162,7 @@ public class SLSRunner extends Configured implements Tool { amClassMap = new HashMap<>(); // runner configuration - tempConf.addResource("sls-runner.xml"); - super.setConf(tempConf); + setConf(tempConf); // runner int poolSize = tempConf.getInt(SLSConfiguration.RUNNER_POOL_SIZE,