Rushabh S Shah commented on HDFS-13109:

Thanks [~hanishakoneru] for the patch.
1. In next method of {{provisionEZTrash}}, need to check if fs instanceof 
If not, then we need to throw UnsupportedOperationException. Check 
{{recoverLease}} method for similar implementation.

private void provisionEZTrash(String path, FsPermission trashPermission)
      throws IOException {
    // make sure the path is an EZ
    EncryptionZone ez = dfs.getEZForPath(path);
I understand that you just moved this method from {{HdfsAdmin}} to 
The variable {{dfs}} in {{HdfsAdmin}} referred to {{DistributedFileSystem}} 
whereas in {{DistributedFileSystem}}, {{dfs}} refers to {{DFSClient}}.
{{DistributedFileSystem#getEZForPath}} resolves the path and calls 
Whereas after the patch, it won't resolve the path.
You have already resolved the path in the calling function {{public void 
provisionEZTrash}}. You can just pass the resolved path to the private method 
{{provisionEZTrash}} instead of {{getPathName}}.
Hope it makes sense.

3. The patch contains diff of imports for the parts of code which you have not 
changed. e.g.{{SnapshotDiffReportListing.DiffReportListingEntry}}
Please reset it.

> Support fully qualified hdfs path in EZ commands
> ------------------------------------------------
>                 Key: HDFS-13109
>                 URL: https://issues.apache.org/jira/browse/HDFS-13109
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs
>            Reporter: Hanisha Koneru
>            Assignee: Hanisha Koneru
>            Priority: Major
>         Attachments: HDFS-13109.001.patch, HDFS-13109.002.patch
> When creating an Encryption Zone, if the fully qualified path is specified in 
> the path argument, it throws the following error.
> {code:java}
> ~$ hdfs crypto -createZone -keyName mykey1 -path hdfs://ns1/zone1
> IllegalArgumentException: hdfs://ns1/zone1 is not the root of an encryption 
> zone. Do you mean /zone1?
> ~$ hdfs crypto -createZone -keyName mykey1 -path "hdfs://namenode:9000/zone2" 
> IllegalArgumentException: hdfs://namenode:9000/zone2 is not the root of an 
> encryption zone. Do you mean /zone2?
> {code}
> The EZ creation succeeds as the path is resolved in 
> DFS#createEncryptionZone(). But while creating the Trash directory, the path 
> is not resolved and it throws the above error.
>  A fully qualified path should be supported by {{crypto}}.

This message was sent by Atlassian JIRA

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