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

Rushabh S Shah commented on HDFS-13512:
---------------------------------------

I was reviewing the latest patch #v5.
+JsonUtil.java+
{noformat}
+        // to maintain backward comparability
         m.put("ecPolicy", status.getErasureCodingPolicy().getName());
+        // to re-construct HdfsFileStatus object via WebHdfs
+        m.put("ecPolicyObj", 
getEcPolicyAsMap(status.getErasureCodingPolicy()));
{noformat}
I am wondering why we want to preserve {{ecPolicy}} in json payload that server 
sends.
On the client side, {{WebhdfsFileSystem}} is not even reading {{ecPolicy}} from 
json.
Also we don't return ec related bits in {{GETFILESTATUS}} via curl also. Refer 
[GETFILESTATUS|https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/WebHDFS.html#Status_of_a_File.2FDirectory]
So it is ok to remove {{ecPolicy}} from {{JsonUtil}} and don't worry about 
backwards compatibility.

While going through history of adding erasure coding policy in 
{{DistributedFileSystem}}, I came across this jira [HDFS-11565].
We should adopt the same logic in {{WebhdfsFileSystem}} also.
Hope it helps.


> WebHdfs getFileStatus doesn't return ecPolicy
> ---------------------------------------------
>
>                 Key: HDFS-13512
>                 URL: https://issues.apache.org/jira/browse/HDFS-13512
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Ajay Kumar
>            Assignee: Ajay Kumar
>            Priority: Major
>         Attachments: HDFS-13512.00.patch, HDFS-13512.01.patch, 
> HDFS-13512.02.patch, HDFS-13512.03.patch, HDFS-13512.04.patch, 
> HDFS-13512.05.patch
>
>
> Currently LISTSTATUS call to WebHdfs returns a json. These jsonArray elements 
> do have the ecPolicy name.
> But when WebHdfsFileSystem converts it back into a FileStatus object, the 
> ecPolicy is not added. This is because the json contains only the ecPolicy 
> name and this name is not sufficient to decode it back to ErasureCodingPolicy 
> object.
> While converting json back to HdfsFileStatus we should set ecPolicyName 
> whenever it is set for give file/dir.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to