[jira] [Commented] (HDFS-10753) Method invocation in log can be replaced by variable because the variable's toString method contains more info
[ https://issues.apache.org/jira/browse/HDFS-10753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15438635#comment-15438635 ] ASF GitHub Bot commented on HDFS-10753: --- GitHub user albericliu opened a pull request: https://github.com/apache/hadoop/pull/122 HDFS-10753.Method invocation in log can be replaced by variable becau… …se the variable's toString method contains more info You can merge this pull request into a Git repository by running: $ git pull https://github.com/albericliu/hadoop branch-2.7.2 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/hadoop/pull/122.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #122 commit 6e46138c457d6eca0943271b3e3cfae26aae2536 Author: Liu AlbericDate: 2016-08-26T07:33:26Z HDFS-10753.Method invocation in log can be replaced by variable because the variable's toString method contains more info > 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-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Commented] (HDFS-10753) Method invocation in log can be replaced by variable because the variable's toString method contains more info
[ https://issues.apache.org/jira/browse/HDFS-10753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15418159#comment-15418159 ] Nemo Chen commented on HDFS-10753: -- Hi [~vrushalic], just want to make sure, I saw the HADOOP-13484 and HADOOP-13485 already in status "Patch Available", for these issues, should I merge them or not? > 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-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Commented] (HDFS-10753) Method invocation in log can be replaced by variable because the variable's toString method contains more info
[ https://issues.apache.org/jira/browse/HDFS-10753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15417783#comment-15417783 ] Nemo Chen commented on HDFS-10753: -- Hi, I made the HDFS-10753, HDFS-10749 superceded by HDFS-10752. For others(mapreduce, yarn) i will create a jira issue which supercedes every related issues. Please let me know if you have problems. > 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-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Commented] (HDFS-10753) Method invocation in log can be replaced by variable because the variable's toString method contains more info
[ https://issues.apache.org/jira/browse/HDFS-10753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15417760#comment-15417760 ] Vrushali C commented on HDFS-10753: --- Pasting a patch for this jira here: {code} diff --git hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/CorruptReplicasMap.java hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/CorruptReplicasMap.java index 35468da..a4ff2df 100644 --- hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/CorruptReplicasMap.java +++ hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/CorruptReplicasMap.java @@ -84,12 +84,12 @@ void addToCorruptReplicasMap(Block blk, DatanodeDescriptor dn, if (!nodes.keySet().contains(dn)) { NameNode.blockStateChangeLog.debug( "BLOCK NameSystem.addToCorruptReplicasMap: {} added as corrupt on " - + "{} by {} {}", blk.getBlockName(), dn, Server.getRemoteIp(), + + "{} by {} {}", blk.toString(), dn, Server.getRemoteIp(), reasonText); } else { NameNode.blockStateChangeLog.debug( "BLOCK NameSystem.addToCorruptReplicasMap: duplicate requested for" + - " {} to add as corrupt on {} by {} {}", blk.getBlockName(), dn, + " {} to add as corrupt on {} by {} {}", blk.toString(), dn, Server.getRemoteIp(), reasonText); } // Add the node or update the reason. {code} > 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-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Commented] (HDFS-10753) Method invocation in log can be replaced by variable because the variable's toString method contains more info
[ https://issues.apache.org/jira/browse/HDFS-10753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15417744#comment-15417744 ] Vrushali C commented on HDFS-10753: --- Yes, sounds good thanks! > 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-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Commented] (HDFS-10753) Method invocation in log can be replaced by variable because the variable's toString method contains more info
[ https://issues.apache.org/jira/browse/HDFS-10753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15417737#comment-15417737 ] Nemo Chen commented on HDFS-10753: -- Hi Vrushali C, Thanks for the suggestion! That's fine by me. Do you want me to merge HDFS-10752 and HDFS-10753? > 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-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Commented] (HDFS-10753) Method invocation in log can be replaced by variable because the variable's toString method contains more info
[ https://issues.apache.org/jira/browse/HDFS-10753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org