From ac853cae4b174e0915b0fde16237044a618d5140 Mon Sep 17 00:00:00 2001 From: ChaosJu Date: Wed, 23 Feb 2022 14:51:23 +0800 Subject: [PATCH] YARN-11080. Improve debug log in ContainerTokenIdentifier when writing ContainerTokenIdentifier to RPC layer --- .../apache/hadoop/yarn/security/ContainerTokenIdentifier.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/security/ContainerTokenIdentifier.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/security/ContainerTokenIdentifier.java index f425e8dfe40..c5b326b8937 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/security/ContainerTokenIdentifier.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/security/ContainerTokenIdentifier.java @@ -326,7 +326,9 @@ public class ContainerTokenIdentifier extends TokenIdentifier { @Override public void write(DataOutput out) throws IOException { - LOG.debug("Writing ContainerTokenIdentifier to RPC layer: {}", this); + if (LOG.isDebugEnabled()) { + LOG.debug("Writing ContainerTokenIdentifier to RPC layer: {}", this); + } out.write(proto.toByteArray()); }