Akira Ajisaka commented on HADOOP-10571:

Thanks [~boky01] for continuing the work! Overall looks good. Minor comments 
from me:
 * DNS.java L434: {{e.getMessage()}} still exists. It can be replaced with 
{{LOG.*(Object, Throwable)}}.
 * AbstractService.java L257: Should it be {{LOG.debug("notefailure ", 
 * OpenFileCtx.java L709, L747, and L1233: Can we avoid {{e.toString()}}?
 * OpenFileCtx.java and RpcProgramNfs3.java: {{handle.dumpFileHandle()}} 
contains string concatenation, so I'm thinking it should be guarded with 
 * OpenFileCtx.java L1113: It should be guarded with {{LOG.isDebugEnabled()}} 
to avoid calling {{Nfs3Utils.getElapsedTime(commit.startTime)}}.
 * OpenFileCtx.java L2214: {{LOG.debug(Nfs3Utils.READ_RPC_START + xid)}} should 
be replaced with {{LOG.debug("{}{}", Nfs3Utils.READ_RPC_START, xid)}}. Similar 
issues are in L2216 and L2219.
 * DataNode.java L1939: {{id.toString()}} can be replaced with {{id}}.
 * DataNode.java L2436: {{Arrays.asList}} seems costly, so it should be guarded 
with {{isDebugEnabled()}}.
 * DataNode.java L2726: Can we avoid {{ex.toString()}}?
 * DataXceiver.java L304 and L313: Can we avoid {{t.toString()}}?
 * DataXceiver.java L922, L961, L997, L1039, and L1100: Can we avoid 
 * Gridmix.java L203: {{inputDir.toString()}} can be replaced with {{inputDir}}.

> Use Log.*(Object, Throwable) overload to log exceptions
> -------------------------------------------------------
>                 Key: HADOOP-10571
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10571
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 2.4.0
>            Reporter: Arpit Agarwal
>            Assignee: Andras Bokor
>            Priority: Major
>         Attachments: HADOOP-10571.01.patch, HADOOP-10571.01.patch, 
> HADOOP-10571.02.patch, HADOOP-10571.03.patch, HADOOP-10571.04.patch, 
> HADOOP-10571.05.patch, HADOOP-10571.06.patch
> When logging an exception, we often convert the exception to string or call 
> {{.getMessage}}. Instead we can use the log method overloads which take 
> {{Throwable}} as a parameter.

This message was sent by Atlassian JIRA

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

Reply via email to