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

Surendra Singh Lilhore commented on HDFS-11968:
-----------------------------------------------

Thanks [~msingh] for patch.
I have some question for your patch.

1. {{ViewFileSystem#resolveStoragePolicyPath()}} why this method is required ?. 
{{fsState.resolve}} already throwing {{FileNotFoundException}}. Only thing is 
proper exception message is missing in {{fsState.resolve}}.

2. What is realId in BlockStoragePolicySpi? 
{code}
+  /**
+   * Return the real id of the storage policy.
+   *
+   * @return the real id of the storage policy.
+   */
+  byte getRealId();
{code}
If it is local policy id for a file/directory then no need to add here. 
{{BlockStoragePolicySpi}} define one policy and its information. I think you 
are trying to get the file/directory local policy ID for 
{{StoragePolicyAdmin#GetStoragePolicyCommand}} command, which is currently 
{{HdfsFileStatus#getStoragePolicy()}} giving. One way to get it is 
{{HDFS-11298}}, but need to think we can add policyid in FileStatus or not.

> ViewFS: StoragePolicies commands fail with HDFS federation
> ----------------------------------------------------------
>
>                 Key: HDFS-11968
>                 URL: https://issues.apache.org/jira/browse/HDFS-11968
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs
>    Affects Versions: 2.7.1
>            Reporter: Mukul Kumar Singh
>            Assignee: Mukul Kumar Singh
>         Attachments: HDFS-11968.001.patch, HDFS-11968.002.patch, 
> HDFS-11968.003.patch, HDFS-11968.004.patch, HDFS-11968.005.patch, 
> HDFS-11968.006.patch
>
>
> hdfs storagepolicies command fails with HDFS federation.
> For storage policies commands, a given user path should be resolved to a HDFS 
> path and
> storage policy command should be applied onto the resolved HDFS path.
> {code}
>   static DistributedFileSystem getDFS(Configuration conf)
>       throws IOException {
>     FileSystem fs = FileSystem.get(conf);
>     if (!(fs instanceof DistributedFileSystem)) {
>       throw new IllegalArgumentException("FileSystem " + fs.getUri() +
>           " is not an HDFS file system");
>     }
>     return (DistributedFileSystem)fs;
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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

Reply via email to