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

Wei-Chiu Chuang commented on HDFS-9350:
---------------------------------------

[~cnauroth], you're absolutely right about it. In HDFS-7284, the original 
intent was to print just the Block portion, not the subclass. We added the 
static method because typecasting doesn't change runtime binding.

If the goal is to avoid creating temp strings, I think we could create a static 
appendStringTo() method, and call the static method instead.

> Avoid creating temprorary strings in Block.toString() and getBlockName()
> ------------------------------------------------------------------------
>
>                 Key: HDFS-9350
>                 URL: https://issues.apache.org/jira/browse/HDFS-9350
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: performance
>    Affects Versions: 2.7.1
>            Reporter: Staffan Friberg
>            Assignee: Staffan Friberg
>            Priority: Minor
>             Fix For: 2.9.0
>
>         Attachments: HDFS-9350.001.patch
>
>
> Minor change to use StringBuilders directly to avoid creating temporary 
> strings of Long and Block name when doing toString on a Block.



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

Reply via email to