From 528a799a784c95cc702e3547a8a294f00743533b Mon Sep 17 00:00:00 2001 From: hemanthboyina Date: Sun, 2 Aug 2020 12:02:37 +0530 Subject: [PATCH] HDFS-15229. Truncate info should be logged at INFO level. Contributed by Ravuri Sushma sree. --- .../apache/hadoop/hdfs/server/namenode/FSNamesystem.java | 2 +- .../hadoop/hdfs/server/namenode/NameNodeRpcServer.java | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java index 72ece88b92..c0cbabb840 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java @@ -2270,7 +2270,7 @@ boolean truncate(String src, long newLength, String clientName, requireEffectiveLayoutVersionForFeature(Feature.TRUNCATE); FSDirTruncateOp.TruncateResult r = null; try { - NameNode.stateChangeLog.debug( + NameNode.stateChangeLog.info( "DIR* NameSystem.truncate: src={} newLength={}", src, newLength); if (newLength < 0) { throw new HadoopIllegalArgumentException( diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java index b42252d9aa..3f1fb5a939 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java @@ -1100,10 +1100,8 @@ public void rename2(String src, String dst, Options.Rename... options) public boolean truncate(String src, long newLength, String clientName) throws IOException { checkNNStartup(); - if(stateChangeLog.isDebugEnabled()) { - stateChangeLog.debug("*DIR* NameNode.truncate: " + src + " to " + - newLength); - } + stateChangeLog + .debug("*DIR* NameNode.truncate: " + src + " to " + newLength); String clientMachine = getClientMachine(); try { return namesystem.truncate(