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

Yi Liu commented on HDFS-7647:
------------------------------

Sorry for coming late, I took a look at this patch again when committing 
HDFS-7756 this morning and find few nits.
I make some cleanup for {{LocatedBlock}} in HDFS-7761 after the patch of this 
JIRA, and details are as following. 
# 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 this JIRA, 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}}

> DatanodeManager.sortLocatedBlocks sorts DatanodeInfos but not StorageIDs
> ------------------------------------------------------------------------
>
>                 Key: HDFS-7647
>                 URL: https://issues.apache.org/jira/browse/HDFS-7647
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 2.6.0
>            Reporter: Milan Desai
>            Assignee: Milan Desai
>             Fix For: 2.7.0
>
>         Attachments: HDFS-7647-2.patch, HDFS-7647-3.patch, HDFS-7647-4.patch, 
> HDFS-7647-5.patch, HDFS-7647-6.patch, HDFS-7647-7.patch, HDFS-7647.patch
>
>
> DatanodeManager.sortLocatedBlocks() sorts the array of DatanodeInfos inside 
> each LocatedBlock, but does not touch the array of StorageIDs and 
> StorageTypes. As a result, the DatanodeInfos and StorageIDs/StorageTypes are 
> mismatched. The method is called by FSNamesystem.getBlockLocations(), so the 
> client will not know which StorageID/Type corresponds to which DatanodeInfo.  



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

Reply via email to