Repository: hadoop Updated Branches: refs/heads/branch-2 588c22e5a -> 1a6cdf97b
HDFS-8522. Change heavily recorded NN logs from INFO to DEBUG level. Contributed by xyao. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/1a6cdf97 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/1a6cdf97 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/1a6cdf97 Branch: refs/heads/branch-2 Commit: 1a6cdf97bb2b2e26de48c4f961918ecba203d649 Parents: 588c22e Author: Xiaoyu Yao <[email protected]> Authored: Fri Jun 5 17:33:06 2015 -0700 Committer: Xiaoyu Yao <[email protected]> Committed: Fri Jun 5 17:33:06 2015 -0700 ---------------------------------------------------------------------- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 2 + .../hdfs/server/namenode/FSNamesystem.java | 73 +++++++++----------- 2 files changed, 33 insertions(+), 42 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/1a6cdf97/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 7c2571a..e5409f7 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -620,6 +620,8 @@ Release 2.7.1 - UNRELEASED HDFS-8523. Remove usage information on unsupported operation "fsck -showprogress" from branch-2 (J.Andreina via vinayakumarb) + HDFS-8522. Change heavily recorded NN logs from INFO to DEBUG level. (xyao) + Release 2.7.0 - 2015-04-20 INCOMPATIBLE CHANGES http://git-wip-us.apache.org/repos/asf/hadoop/blob/1a6cdf97/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java ---------------------------------------------------------------------- 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 aa09353..638146d 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 @@ -2010,10 +2010,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, long mtime) throws IOException, UnresolvedLinkException { String src = srcArg; - if (NameNode.stateChangeLog.isDebugEnabled()) { - NameNode.stateChangeLog.debug("DIR* NameSystem.truncate: src=" - + src + " newLength=" + newLength); - } + NameNode.stateChangeLog.debug( + "DIR* NameSystem.truncate: src={} newLength={}", src, newLength); if (newLength < 0) { throw new HadoopIllegalArgumentException( "Cannot truncate to a negative file size: " + newLength + "."); @@ -2162,10 +2160,10 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, file.setLastBlock(truncatedBlockUC, blockManager.getStorages(oldBlock)); getBlockManager().addBlockCollection(truncatedBlockUC, file); - NameNode.stateChangeLog.info("BLOCK* prepareFileForTruncate: " - + "Scheduling copy-on-truncate to new size " - + truncatedBlockUC.getNumBytes() + " new block " + newBlock - + " old block " + truncatedBlockUC.getTruncateBlock()); + NameNode.stateChangeLog.debug( + "BLOCK* prepareFileForTruncate: Scheduling copy-on-truncate to new" + + " size {} new block {} old block {}", truncatedBlockUC.getNumBytes(), + newBlock, truncatedBlockUC.getTruncateBlock()); } else { // Use new generation stamp for in-place truncate recovery blockManager.convertLastBlockToUnderConstruction(file, lastBlockDelta); @@ -2178,10 +2176,10 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, truncatedBlockUC.getTruncateBlock().setGenerationStamp( newBlock.getGenerationStamp()); - NameNode.stateChangeLog.debug("BLOCK* prepareFileForTruncate: " - + "Scheduling in-place block truncate to new size " - + truncatedBlockUC.getTruncateBlock().getNumBytes() - + " block=" + truncatedBlockUC); + NameNode.stateChangeLog.debug( + "BLOCK* prepareFileForTruncate: Scheduling in-place block" + + " truncate to new size {} block= {}", + truncatedBlockUC.getTruncateBlock().getNumBytes(), truncatedBlockUC); } if (shouldRecoverNow) { truncatedBlockUC.initializeBlockRecovery(newBlock.getGenerationStamp()); @@ -2765,11 +2763,9 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, String clientMachine, boolean newBlock, boolean logRetryCache) throws IOException { String src = srcArg; - if (NameNode.stateChangeLog.isDebugEnabled()) { - NameNode.stateChangeLog.debug("DIR* NameSystem.appendFile: src=" + src - + ", holder=" + holder - + ", clientMachine=" + clientMachine); - } + NameNode.stateChangeLog.debug( + "DIR* NameSystem.appendFile: src={}, holder={}, clientMachine={}", + src, holder, clientMachine); boolean skipSync = false; if (!supportAppends) { throw new UnsupportedOperationException( @@ -2803,12 +2799,10 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, } } if (lb != null) { - if (NameNode.stateChangeLog.isDebugEnabled()) { - NameNode.stateChangeLog.debug("DIR* NameSystem.appendFile: file " - +src+" for "+holder+" at "+clientMachine - +" block " + lb.getBlock() - +" block size " + lb.getBlock().getNumBytes()); - } + NameNode.stateChangeLog.debug( + "DIR* NameSystem.appendFile: file {} for {} at {} block {} block" + + " size {}", src, holder, clientMachine, lb.getBlock(), + lb.getBlock().getNumBytes()); } logAuditEvent(true, "append", srcArg); return new LastBlockWithStatus(lb, stat); @@ -2837,10 +2831,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, LocatedBlock getAdditionalBlock( String src, long fileId, String clientName, ExtendedBlock previous, DatanodeInfo[] excludedNodes, String[] favoredNodes) throws IOException { - if(NameNode.stateChangeLog.isDebugEnabled()) { - NameNode.stateChangeLog.debug("BLOCK* getAdditionalBlock: " - + src + " inodeId " + fileId + " for " + clientName); - } + NameNode.stateChangeLog.debug("BLOCK* getAdditionalBlock: {} inodeId {}" + + " for {}", src, fileId, clientName); waitForLoadingFSImage(); LocatedBlock[] onRetryBlock = new LocatedBlock[1]; @@ -2947,10 +2939,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, */ void abandonBlock(ExtendedBlock b, long fileId, String src, String holder) throws IOException { - if(NameNode.stateChangeLog.isDebugEnabled()) { - NameNode.stateChangeLog.debug("BLOCK* NameSystem.abandonBlock: " + b - + "of file " + src); - } + NameNode.stateChangeLog.debug( + "BLOCK* NameSystem.abandonBlock: {} of file {}", b, src); waitForLoadingFSImage(); checkOperation(OperationCategory.WRITE); FSPermissionChecker pc = getPermissionChecker(); @@ -2959,10 +2949,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, checkOperation(OperationCategory.WRITE); checkNameNodeSafeMode("Cannot abandon block " + b + " for file" + src); FSDirWriteFileOp.abandonBlock(dir, pc, b, fileId, src, holder); - if(NameNode.stateChangeLog.isDebugEnabled()) { - NameNode.stateChangeLog.debug("BLOCK* NameSystem.abandonBlock: " - + b + " is removed from pendingCreates"); - } + NameNode.stateChangeLog.debug("BLOCK* NameSystem.abandonBlock: {} is" + + " removed from pendingCreates", b); } finally { writeUnlock(); } @@ -4036,11 +4024,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, waitForLoadingFSImage(); // file is closed getEditLog().logCloseFile(path, file); - if (NameNode.stateChangeLog.isDebugEnabled()) { - NameNode.stateChangeLog.debug("closeFile: " - +path+" with "+ file.getBlocks().length - +" blocks is persisted to the file system"); - } + NameNode.stateChangeLog.debug("closeFile: {} with {} bloks is persisted" + + " to the file system", path, file.getBlocks().length); } /** @@ -5898,7 +5883,9 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, if (cookieTab[0] == null) { cookieTab[0] = String.valueOf(getIntCookie(cookieTab[0])); } - LOG.info("there are no corrupt file blocks."); + if (LOG.isDebugEnabled()) { + LOG.debug("there are no corrupt file blocks."); + } return corruptFiles; } @@ -5933,7 +5920,9 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, } } cookieTab[0] = String.valueOf(skip); - LOG.info("list corrupt file blocks returned: " + count); + if (LOG.isDebugEnabled()) { + LOG.debug("list corrupt file blocks returned: " + count); + } return corruptFiles; } finally { readUnlock();
