Ver Fonte

YARN-10448. SLS should set default user to handle SYNTH format. Contributed by zhuqi

Adam Antal há 4 anos atrás
pai
commit
bd8cf7fd4c

+ 4 - 1
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 boolean exitAtTheFinish = false;
 
 
+  private static final String DEFAULT_USER = "default";
+
   /**
   /**
    * The type of trace in input.
    * The type of trace in input.
    */
    */
@@ -732,7 +734,8 @@ public class SLSRunner extends Configured implements Tool {
     // creation
     // creation
     while ((job = (SynthJob) stjp.getNextJob()) != null) {
     while ((job = (SynthJob) stjp.getNextJob()) != null) {
       // only support MapReduce currently
       // only support MapReduce currently
-      String user = job.getUser();
+      String user = job.getUser() == null ? DEFAULT_USER :
+              job.getUser();
       String jobQueue = job.getQueueName();
       String jobQueue = job.getQueueName();
       String oldJobId = job.getJobID().toString();
       String oldJobId = job.getJobID().toString();
       long jobStartTimeMS = job.getSubmissionTime();
       long jobStartTimeMS = job.getSubmissionTime();