From 40e6a85d25387d4025585c5726b3e4e24c2c1572 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 f66d2d0494..e679c9de20 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 SLSRunner(Configuration tempConf) throws ClassNotFoundException { 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 @@ private void init(Configuration tempConf) throws ClassNotFoundException { amClassMap = new HashMap<>(); // runner configuration - tempConf.addResource("sls-runner.xml"); - super.setConf(tempConf); + setConf(tempConf); // runner int poolSize = tempConf.getInt(SLSConfiguration.RUNNER_POOL_SIZE,