[ 
https://issues.apache.org/jira/browse/HDFS-7258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14181931#comment-14181931
 ] 

Colin Patrick McCabe commented on HDFS-7258:
--------------------------------------------

Hi [~xyao], you don't need the "if" statements any more.  slf4j is smart enough 
to not do any extra work if debug is not turned on.  See 
http://javarevisited.blogspot.com/2013/08/why-use-sl4j-over-log4j-for-logging-in.html
 for details.

So instead of this:
{code}
182                   if (LOG.isDebugEnabled()) {
183                     LOG.debug("Rescanning after " + (curTimeMs - 
startTimeMs) +
184                       " milliseconds");
185                   }
{code}

You just need this:
{code}
LOG.debug("Rescanning after {} milliseconds", curTimeMs - startTimeMs);
{code}

Similar comment for the {{LOG.debug("Scanned " + scannedDirectives ...}} log 
statement.

> CacheReplicationMonitor rescan schedule log should use DEBUG level instead of 
> INFO level
> ----------------------------------------------------------------------------------------
>
>                 Key: HDFS-7258
>                 URL: https://issues.apache.org/jira/browse/HDFS-7258
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>    Affects Versions: 2.6.0
>            Reporter: Xiaoyu Yao
>            Assignee: Colin Patrick McCabe
>            Priority: Minor
>             Fix For: 3.0.0
>
>         Attachments: HDFS-7258.0.patch
>
>
> CacheReplicationMonitor rescan scheduler adds two INFO log entries every 30 
> seconds to HDSF NN log as shown below. This should be a DEBUG level log to 
> avoid flooding the namenode log.  
> 2014-10-17 07:52:30,265 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Rescanning after 30000 milliseconds
> 2014-10-17 07:52:30,265 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Scanned 0 directive(s) and 0 block(s) in 0 millisecond(s).
> 2014-10-17 07:53:00,265 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Rescanning after 30001 milliseconds
> 2014-10-17 07:53:00,266 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Scanned 0 directive(s) and 0 block(s) in 1 millisecond(s).
> 2014-10-17 07:53:30,267 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Rescanning after 30001 milliseconds
> 2014-10-17 07:53:30,267 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Scanned 0 directive(s) and 0 block(s) in 0 millisecond(s).
> 2014-10-17 07:54:00,267 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Rescanning after 30001 milliseconds
> 2014-10-17 07:54:00,268 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Scanned 0 directive(s) and 0 block(s) in 0 millisecond(s).
> 2014-10-17 07:54:30,268 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Rescanning after 30001 milliseconds
> 2014-10-17 07:54:30,269 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Scanned 0 directive(s) and 0 block(s) in 0 millisecond(s).
> 2014-10-17 07:55:00,269 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Rescanning after 30000 milliseconds
> 2014-10-17 07:55:00,269 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Scanned 0 directive(s) and 0 block(s) in 1 millisecond(s).
> 2014-10-17 07:55:30,268 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Rescanning after 30000 milliseconds
> 2014-10-17 07:55:30,269 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Scanned 0 directive(s) and 0 block(s) in 0 millisecond(s).
> 2014-10-17 07:56:00,269 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Rescanning after 30001 milliseconds
> 2014-10-17 07:56:00,270 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Scanned 0 directive(s) and 0 block(s) in 0 millisecond(s).
> 2014-10-17 07:56:30,270 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Rescanning after 30001 milliseconds
> 2014-10-17 07:56:30,271 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Scanned 0 directive(s) and 0 block(s) in 0 millisecond(s).
> 2014-10-17 07:57:00,271 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Rescanning after 30000 milliseconds
> 2014-10-17 07:57:00,272 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Scanned 0 directive(s) and 0 block(s) in 1 millisecond(s).
> 2014-10-17 07:57:30,271 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Rescanning after 30000 milliseconds
> 2014-10-17 07:57:30,272 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Scanned 0 directive(s) and 0 block(s) in 1 millisecond(s).
> 2014-10-17 07:58:00,271 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Rescanning after 30000 milliseconds
> 2014-10-17 07:58:00,271 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Scanned 0 directive(s) and 0 block(s) in 1 millisecond(s).
> 2014-10-17 07:58:30,271 INFO 
> org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: 
> Rescanning after 30000 milliseconds



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to