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

Mukul Kumar Singh commented on HDFS-11968:
------------------------------------------

Thanks for the review [~surendrasingh]

1) No need to catch FileNotFoundException explicitly in 
UnsetStoragePolicyCommand and SetStoragePolicyCommand. In 
GetStoragePolicyCommand handling FileNotFoundException because of compatibility 
issue. Message give by DistributedFileSystem in FileNotFoundException is 
different from the message in GetStoragePolicyCommand. I don't want to change 
it. 

bq. The exception handling in UnsetStoragePolicyCommand/SetStoragePolicyCommand 
is needed to make sure that the error message returned as part of 
ViewFileSystem is the same as the one returned by HDFS.
If FileNotFoundException is not handled then the error message will be 
{{FileNotFoundException: /fooz}} where as for HDFS a FileNotFoundException 
results in error mesage {{File/Directory does not exist: /fooz }}.

We can decide to either have different error messages for ViewFileSystem or 
this can be fixed by modifying the exception message in 
{{InodeTree.java:resolve}}
{code}
          failedAt.append('/').append(path[j]);
        }
        throw (new FileNotFoundException(failedAt.toString()));
      }
{code}
or by handling the FileNotFoundException in the 
UnsetStoragePolicyCommand/SetStoragePolicyCommand handler.

Please let me know of you opinion :)

2) Please handle the checkstyle warnings.
bq. In order to write unit test with WebHDFSFileSystem and ViewFileSystem, 
fields conf, cluster and fs have been made protected which is resulting in the 
checkstyle warning.  

> 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-11968.007.patch, HDFS-11968.008.patch, 
> HDFS-11968.009.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: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to