hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vrushali C (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-10753) Method invocation in log can be replaced by variable because the variable's toString method contains more info
Date Thu, 11 Aug 2016 18:37:20 GMT

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

Vrushali C commented on HDFS-10753:
-----------------------------------

Hi [~chenfsd]

Just a suggestion, given that these are relatively smaller changes (like in HDFS-10752 as
well), I think it might be a good idea to file one jira for several of these suggestions per
project? Perhaps one jira for HDFS, one for MAPREDUCE, one for YARN. 

thanks
Vrushali


> Method invocation in log can be replaced by variable because the variable's toString
method contains more info
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-10753
>                 URL: https://issues.apache.org/jira/browse/HDFS-10753
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 2.7.2
>            Reporter: Nemo Chen
>              Labels: easyfix, easytest
>
> Similar to the fix in HADOOP-6419, in file:
> hadoop-rel-release-2.7.2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/CorruptReplicasMap.java
> in line 76, the blk.getBlockName() method invocation is invoked on variable blk. "blk"
is the class instance of Block.
> {code}
> void addToCorruptReplicasMap(Block blk, DatanodeDescriptor dn,
>       String reason, Reason reasonCode) {
> ...
> NameNode.blockStateChangeLog.info(
>           "BLOCK NameSystem.addToCorruptReplicasMap: {} added as corrupt on "
>               + "{} by {} {}", blk.getBlockName(), dn, Server.getRemoteIp(),
>           reasonText);
> {code}
> In file: hadoop-rel-release-2.7.2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/Block.java
> {code}
>   @Override
>   public String toString() {
>     return getBlockName() + "_" + getGenerationStamp();
>   }
> {code}
> The toString() method contain not only getBlockName() but also getGenerationStamp which
may be helpful for debugging purpose. Therefore blk.getBlockName() can be replaced by blk



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

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


Mime
View raw message