You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Walter Su (JIRA)" <ji...@apache.org> on 2015/08/28 04:22:45 UTC

[jira] [Commented] (HDFS-8971) Remove guards when calling LOG.debug() and LOG.trace() in client package

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

Walter Su commented on HDFS-8971:
---------------------------------

Before you removes the guard, you should change the log to slf4j-style with placeholder, to eliminate String concatenation. That's what the guard used for.

> 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
>
> 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}
> 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.



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