You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/05/11 14:20:44 UTC

[GitHub] [hadoop] slfan1989 commented on pull request #4293: YARN-11137. Fix Slf4j Log CodeStyle

slfan1989 commented on PR #4293:
URL: https://github.com/apache/hadoop/pull/4293#issuecomment-1123836348

   > LOG.isInfoEnabled()
   
   When I was reading yarn's code, I found a similar usage in NMAuditLogger.java or RMAuditLogger.java, as follows:
   
   org.apache.hadoop.yarn.server.resourcemanager#logSuccess
   
   ```
   public static void logSuccess(String user, String operation, String target, 
         ApplicationId appId, ContainerId containerId, Resource resource) {
       if (LOG.isInfoEnabled()) {
         LOG.info(createSuccessLog(user, operation, target, appId, null, 
             containerId, resource));
       }
     }
   ```
   
   Some code data I read earlier pointed out that this method effectively checks the log level, which is helpful for the performance of scenarios with high concurrency. I would like to hear your opinion.
   
   My consideration is the submitApplication of yarn federation, which is also a high-performance scenario, so I added LOG.isInfoEnabled() check .
   
   Line 450, according to my understanding should also be added.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org