You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-issues@hadoop.apache.org by "Tsuyoshi Ozawa (JIRA)" <ji...@apache.org> on 2015/09/08 13:58:46 UTC

[jira] [Commented] (MAPREDUCE-6468) Consistent log severity level guards and statements in RMContainerAllocator

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

Tsuyoshi Ozawa commented on MAPREDUCE-6468:
-------------------------------------------

[~jagadesh.kiran] Before checking this in, I've checked initial patch by Jackie. We should fix the inconsistency of log levels here in other files also.

1. RMContainerRequestor
{code}
    if (LOG.isDebugEnabled()) {
      LOG.info("AFTER decResourceRequest:" + " applicationId="
          + applicationId.getId() + " priority=" + priority.getPriority()
          + " resourceName=" + resourceName + " numContainers="
          + remoteRequest.getNumContainers() + " #asks=" + ask.size());
    }
{code}
2. LeafQueue
{code}
    if (LOG.isDebugEnabled()) {
      LOG.info(getQueueName() + 
          " user=" + userName + 
          " used=" + queueUsage.getUsed() + " numContainers=" + numContainers +
          " headroom = " + application.getHeadroom() +
          " user-resources=" + user.getUsed()
          );
    }
{code}
3. ContainerTokenSelector
{code}
    for (Token<? extends TokenIdentifier> token : tokens) {
      if (LOG.isDebugEnabled()) {
        LOG.info("Looking for service: " + service + ". Current token is "
            + token);
      }
      if (ContainerTokenIdentifier.KIND.equals(token.getKind()) && 
          service.equals(token.getService())) {
        return (Token<ContainerTokenIdentifier>) token;
      }
    }
{code}
and so on. Could you check his patch( https://issues.apache.org/jira/secure/attachment/12605179/HADOOP-9995.patch ) and update them also?

> Consistent log severity level guards and statements in RMContainerAllocator
> ---------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-6468
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-6468
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>            Reporter: Jackie Chang
>            Assignee: Jagadesh Kiran N
>            Priority: Minor
>              Labels: BB2015-05-TBR
>         Attachments: HADOOP-9995-00.patch, HADOOP-9995.patch, MAPREDUCE-6468-01.patch
>
>
> Developers use logs to do in-house debugging. These log statements are later demoted to less severe levels and usually are guarded by their matching severity levels. However, we do see inconsistencies in trunk. A log statement like 
> {code}
>        if (LOG.isDebugEnabled()) {
>         LOG.info("Assigned container (" + allocated + ") "
> {code}
> doesn't make much sense because the log message is actually only printed out in DEBUG-level. We do see previous issues tried to correct this inconsistency. I am proposing a comprehensive correction over trunk.
> Doug Cutting pointed it out in HADOOP-312: https://issues.apache.org/jira/browse/HADOOP-312?focusedCommentId=12429498&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12429498
> HDFS-1611 also corrected this inconsistency.
> This could have been avoided by switching from log4j to slf4j's {} format like CASSANDRA-625 (2010/3) and ZOOKEEPER-850 (2012/1), which gives cleaner code and slightly higher performance.



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