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

Arpit Agarwal commented on HDFS-5417:
-------------------------------------

Hi Nicholas,

Should we fix the reverse convert routine for consistency?

{code}
  public static LocatedBlock convert(LocatedBlockProto proto) {
...
    LocatedBlock lb = new LocatedBlock(PBHelper.convert(proto.getB()), targets,
        proto.getStorageIDsList().toArray(new 
String[proto.getStorageIDsCount()]),
{code}

to be something like:
{code}
    LocatedBlock lb = new LocatedBlock(PBHelper.convert(proto.getB()), targets,
     proto.getStorageIDsCount() == 0 ? null : 
proto.getStorageIDsList().toArray(new String[proto.getStorageIDsCount()]),
{code}

+1 otherwise.

I filed HDFS-5423 to verify other initializations of 
LocatedBlock/RecoveringBlock to see if we missed StorageIDs.

Thanks.

> Fix storage IDs in PBHelper and UpgradeUtilities
> ------------------------------------------------
>
>                 Key: HDFS-5417
>                 URL: https://issues.apache.org/jira/browse/HDFS-5417
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Tsz Wo (Nicholas), SZE
>            Assignee: Tsz Wo (Nicholas), SZE
>            Priority: Minor
>         Attachments: h5417_20131024.patch
>
>
> - PBHelper should check null for storage IDs when converting LocatedBlock.
> - UpgradeUtilities should createStorageID in createDataNodeVersionFile(..).



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to