From 462561654bb37dc1d453bfe15c3e75c274bbfb02 Mon Sep 17 00:00:00 2001 From: Eric Badger Date: Tue, 9 Feb 2021 19:01:38 +0000 Subject: [PATCH] MAPREDUCE-7319. Log list of mappers at trace level in ShuffleHandler audit log. Contributed by Jim Brennan. --- .../java/org/apache/hadoop/mapred/ShuffleHandler.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java index 62be3a08e8..1d5b475ea7 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java @@ -1170,8 +1170,13 @@ protected void populateHeaders(List mapIds, String jobId, StringBuilder sb = new StringBuilder("shuffle for "); sb.append(jobId).append(" reducer ").append(reduce); sb.append(" length ").append(contentLength); - sb.append(" mappers: ").append(mapIds); - AUDITLOG.debug(sb.toString()); + if (AUDITLOG.isTraceEnabled()) { + // For trace level logging, append the list of mappers + sb.append(" mappers: ").append(mapIds); + AUDITLOG.trace(sb.toString()); + } else { + AUDITLOG.debug(sb.toString()); + } } }