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

ASF GitHub Bot commented on HDFS-8971:
--------------------------------------

Github user liuml07 commented on the issue:

    https://github.com/apache/hadoop/pull/46
  
    Can you create a JIRA on https://issues.apache.org/jira/browse/HDFS and 
change the title of this PR  to link the JIRA here? See 
https://wiki.apache.org/hadoop/GithubIntegration for more information.
    
    For the code, the DataNode logging has switched to slf4j. Please use 
placeholders and guard statement like `if (LOG.isTraceEnabled())` is 
unnecessary. Please refer to https://issues.apache.org/jira/browse/HDFS-8971 
for examples.


> Remove guards when calling LOG.debug() and LOG.trace() in client package
> ------------------------------------------------------------------------
>
>                 Key: HDFS-8971
>                 URL: https://issues.apache.org/jira/browse/HDFS-8971
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: build
>            Reporter: Mingliang Liu
>            Assignee: Mingliang Liu
>             Fix For: 2.8.0, 3.0.0-alpha1
>
>         Attachments: HDFS-8971.000.patch, HDFS-8971.001.patch
>
>
> We moved the {{shortcircuit}} package from {{hadoop-hdfs}} to 
> {{hadoop-hdfs-client}} module in JIRA 
> [HDFS-8934|https://issues.apache.org/jira/browse/HDFS-8934] and 
> [HDFS-8951|https://issues.apache.org/jira/browse/HDFS-8951], and 
> {{BlockReader}} in 
> [HDFS-8925|https://issues.apache.org/jira/browse/HDFS-8925]. Meanwhile, we 
> also replaced the _log4j_ log with _slf4j_ logger. There were existing code 
> in the client package to guard the log when calling {{LOG.debug()}} and 
> {{LOG.trace()}}, e.g. in {{ShortCircuitCache.java}}, we have code like this:
> {code:title=Trace with guards|borderStyle=solid}
> 724    if (LOG.isTraceEnabled()) {
> 725      LOG.trace(this + ": found waitable for " + key);
> 726    }
> {code}
> In _slf4j_, this kind of guard is not necessary. We should clean the code by 
> removing the guard from the client package.
> {code:title=Trace without guards|borderStyle=solid}
> 724    LOG.trace("{}: found waitable for {}", this, key);
> {code}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to