From bd8cf7fd4ce41d6d91a3b080632266d147d1ec81 Mon Sep 17 00:00:00 2001 From: Adam Antal Date: Tue, 13 Oct 2020 17:54:15 +0200 Subject: [PATCH] YARN-10448. SLS should set default user to handle SYNTH format. Contributed by zhuqi --- .../src/main/java/org/apache/hadoop/yarn/sls/SLSRunner.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 5bfa8dc021a..b4d4a809bb6 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 @@ -143,6 +143,8 @@ public class SLSRunner extends Configured implements Tool { private static boolean exitAtTheFinish = false; + private static final String DEFAULT_USER = "default"; + /** * The type of trace in input. */ @@ -732,7 +734,8 @@ public class SLSRunner extends Configured implements Tool { // creation while ((job = (SynthJob) stjp.getNextJob()) != null) { // only support MapReduce currently - String user = job.getUser(); + String user = job.getUser() == null ? DEFAULT_USER : + job.getUser(); String jobQueue = job.getQueueName(); String oldJobId = job.getJobID().toString(); long jobStartTimeMS = job.getSubmissionTime();