[
https://issues.apache.org/jira/browse/HDFS-7761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14317393#comment-14317393
]
Arpit Agarwal commented on HDFS-7761:
-------------------------------------
You are right. I took a quick look at this call from {{sortLocatedBlocks}} but
missed the lack of allocation.
{code}
// must update cache since we modified locations array
b.updateCachedStorageInfo();
{code}
+1 for the patch.
> 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)