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

Manoj Govindassamy commented on HDFS-10983:
-------------------------------------------

Thanks for the review [~andrew.wang].

If we don't set replication explicitly for Striped blocks, the field is 0 by 
default and anyone reading this replication field from the FSImage would be 
surprised. So, am explicitly setting it to DEFAULT_REPL_FOR_STRIPED_BLOCKS. 
Example, in {{PBImageXMLWriter#dumpINodeFile}}, the previous code was just read 
the replication field and dump in xml as is, which could be wrong for Striped 
blocks. So, I later changed to read the file type and dump replication param 
accordingly. Though this was fixed, i was worried about similar readers not 
caring about striped files and just reading replication param. 

{{FSImageFormatPBInode}}
{code}
    public static INodeSection.INodeFile.Builder buildINodeFile(
        INodeFileAttributes file, final SaverContext state) {
      INodeSection.INodeFile.Builder b = INodeSection.INodeFile.newBuilder()
          .setAccessTime ...

      if (file.isStriped()) {
        b.setReplication(INodeFile.DEFAULT_REPL_FOR_STRIPED_BLOCKS);
        b.setErasureCodingPolicyID(file.getErasureCodingPolicyID());
      } else {
        b.setReplication(file.getFileReplication());
      }
{code}

> OIV tool should make an EC file explicit
> ----------------------------------------
>
>                 Key: HDFS-10983
>                 URL: https://issues.apache.org/jira/browse/HDFS-10983
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>    Affects Versions: 3.0.0-alpha1
>            Reporter: Wei-Chiu Chuang
>            Assignee: Manoj Govindassamy
>              Labels: hdfs-ec-3.0-nice-to-have
>         Attachments: HDFS-10983.01.patch, HDFS-10983.02.patch
>
>
> The OIV tool's webhdfs interface does not print if a file is striped or not.
> Also, it prints the file's EC policy ID as replication factor, which is 
> inconsistent to the output of a typical webhdfs call to the cluster, which 
> always shows replication factor of 0 for EC files.
> Not just webhdfs, but delimiter output does not print if a file is stripped 
> or not either.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to