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

Arpit Agarwal commented on HDFS-7761:
-------------------------------------

Hi [~hitliuyi], thanks for posting this cleanup patch.

I did take a look at your patch earlier today. The changes make the code 
cleaner but one disadvantage is that we are always allocating the cached 
arrays. I think it is better to allocate them on-demand.

> cleanup unnecssary code logic in LocatedBlock
> ---------------------------------------------
>
>                 Key: HDFS-7761
>                 URL: https://issues.apache.org/jira/browse/HDFS-7761
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>    Affects Versions: 2.7.0
>            Reporter: Yi Liu
>            Assignee: Yi Liu
>            Priority: Minor
>         Attachments: HDFS-7761.001.patch, HDFS-7761.002.patch
>
>
> # The usage of following two variables is unnecessary. We can remove them to 
> make code a bit brief.
> {quote}
> private final boolean hasStorageIDs;
> private final boolean hasStorageTypes;
> {quote}
> # In HDFS-7647, no need to modify {{LocatedBlock#getStorageTypes}} and 
> {{LocatedBlock#getStorageIDs}}, we just need to update the cached 
> {{storageIDs}} and {{storageTypes}} after *sort*.
> # Another thing is we'd better setSoftwareVersion when constructing 
> {{DatanodeInfoWithStorage}} from {{DatanodeInfo}}



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

Reply via email to