From 5404ab4bca1884a7421d17a96b1b188790eecc47 Mon Sep 17 00:00:00 2001 From: Ayush Saxena Date: Fri, 14 May 2021 00:15:33 +0530 Subject: [PATCH] MAPREDUCE-7343. Increase the job name max length in mapred job -list. (#2995). Contributed by Ayush Saxena. --- .../main/java/org/apache/hadoop/mapreduce/tools/CLI.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/tools/CLI.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/tools/CLI.java index 82e73463c4..530ee91184 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/tools/CLI.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/tools/CLI.java @@ -771,10 +771,10 @@ public void displayJobList(JobStatus[] jobs) } @Private - public static String headerPattern = "%23s\t%20s\t%10s\t%14s\t%12s\t%12s" + + public static String headerPattern = "%23s\t%40s\t%10s\t%14s\t%12s\t%12s" + "\t%10s\t%15s\t%15s\t%8s\t%8s\t%10s\t%10s\n"; @Private - public static String dataPattern = "%23s\t%20s\t%10s\t%14d\t%12s\t%12s" + + public static String dataPattern = "%23s\t%40s\t%10s\t%14d\t%12s\t%12s" + "\t%10s\t%15s\t%15s\t%8s\t%8s\t%10s\t%10s\n"; private static String memPattern = "%dM"; private static String UNAVAILABLE = "N/A"; @@ -792,8 +792,8 @@ public void displayJobList(JobStatus[] jobs, PrintWriter writer) { long rsvdMem = job.getReservedMem(); long neededMem = job.getNeededMem(); int jobNameLength = job.getJobName().length(); - writer.printf(dataPattern, job.getJobID().toString(), - job.getJobName().substring(0, jobNameLength > 20 ? 20 : jobNameLength), + writer.printf(dataPattern, job.getJobID().toString(), job.getJobName() + .substring(0, jobNameLength > 40 ? 40 : jobNameLength), job.getState(), job.getStartTime(), job.getUsername(), job.getQueue(), job.getPriority().name(), numUsedSlots < 0 ? UNAVAILABLE : numUsedSlots,