From 101852ca11ed4a9c4d4664c6c797fa7173dc59ae Mon Sep 17 00:00:00 2001 From: Robert Kanter Date: Tue, 16 May 2017 17:52:17 -0700 Subject: [PATCH] YARN-6535. Program needs to exit when SLS finishes. (yufeigu via rkanter) --- .../src/main/java/org/apache/hadoop/yarn/sls/SLSRunner.java | 6 ++++++ 1 file changed, 6 insertions(+) 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 03281a5f541..f66d2d0494c 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 @@ -124,6 +124,8 @@ public class SLSRunner extends Configured implements Tool { private final static int DEFAULT_MAPPER_PRIORITY = 20; private final static int DEFAULT_REDUCER_PRIORITY = 10; + private static boolean exitAtTheFinish = false; + /** * The type of trace in input. */ @@ -761,6 +763,9 @@ public class SLSRunner extends Configured implements Tool { if (remainingApps == 0) { LOG.info("SLSRunner tears down."); + if (exitAtTheFinish) { + System.exit(0); + } } } @@ -857,6 +862,7 @@ public class SLSRunner extends Configured implements Tool { } public static void main(String[] argv) throws Exception { + exitAtTheFinish = true; ToolRunner.run(new Configuration(), new SLSRunner(), argv); }