[ https://issues.apache.org/jira/browse/HDFS-13109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16386353#comment-16386353 ]
Rushabh S Shah commented on HDFS-13109: --------------------------------------- +HdfsAdmin.java+ If I understand the jira correctly, this check is the problem. {code:title=HdfsAdmin.java|borderStyle=solid} private void provisionEZTrash(Path path) throws IOException { ... String ezPath = ez.getPath(); if (!path.toString().equals(ezPath)) { throw new IllegalArgumentException(path + " is not the root of an " + "encryption zone. Do you mean " + ez.getPath() + "?"); } ... } {code} This if condition is comparing the path including scheme and authority with the path that doesn't contain scheme and authority. If you use the {{Path#getPathWithoutSchemeAndAuthority}}, then it will just compare the path component of the uri. Something like this. {noformat} String ezPath = ez.getPath(); if (!Path.getPathWithoutSchemeAndAuthority(path).toString().equals(ezPath)) { throw new IllegalArgumentException(path + " is not the root of an " + "encryption zone. Do you mean " + ez.getPath() + "?"); } {noformat} This will get rid of all the change in {{DistributedFileSystem}} and {{HdfsAdmin}} related code in the patch. +TestEncryptionZones+ 1. bq. assertZonePresent(null, zone1.toString()); For both the {{assertZonePresent}} checks, we should pass the key string (TEST_KEY) and verify that EZ was created with that specific key. 2. In first case i.e {{Create EZ with Trash}}, I would like to see a check that {{zone1's}} path contains a trash directory. > 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, > HDFS-13109.003.patch, HDFS-13109.004.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 (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