hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Suresh Srinivas (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-6884) Add LOG.isDebugEnabled() guard for each LOG.debug("...")
Date Mon, 16 Aug 2010 21:09:19 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-6884?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12899089#action_12899089

Suresh Srinivas commented on HADOOP-6884:

I have additional concerns about AOP. Herriot plans to introduce AOP based interfaces for
exposing system internals. This should not be deployed on production clusters. Using AOP to
check isDebugEnabled(), results in two flavors of AOP code. One that must be deployed on the
system and the other that should not be. Confusion here could result in serious issues.

Second, with AOP, if some one deploys the version without AOP based debug check, there is
no way to know if the check is happening or not, by the system behavior alone.

My vote is to keep it simple for now and check in the code changes that Erik has. This is
a widely used java coding practice and not a huge code bloat. If others still feel that this
causes code bloat, we could further choose one of the choices proposed in the jira. At that
time, we need to any way remove all debug enabled checks that are currently being made.

> Add LOG.isDebugEnabled() guard for each LOG.debug("...")
> --------------------------------------------------------
>                 Key: HADOOP-6884
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6884
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Erik Steffl
>            Assignee: Erik Steffl
>             Fix For: 0.22.0
>         Attachments: HADOOP-6884-0.22-1.patch, HADOOP-6884-0.22.patch
> Each LOG.debug("...") should be executed only if LOG.isDebugEnabled() is true, in some
cases it's expensive to construct the string that is being printed to log. It's much easier
to always use LOG.isDebugEnabled() because it's easier to check (rather than in each case
reason whether it's necessary or not).

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message