[
https://issues.apache.org/jira/browse/HDFS-5482?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13817679#comment-13817679
]
Chris Nauroth commented on HDFS-5482:
-------------------------------------
-listDirectives with a path filter has the same problem. (See below.)
I think the fix needs to go in
{{DistributedFileSystem#listPathBasedCacheDescriptors}}. Before HDFS-5326, we
had a call to {{FileSystem#fixRelativePart}} in there. Fixing it in
{{DistributedFileSystem#listPathBasedCacheDescriptors}} would cover both
-listDirectives and -removeDirectives as well as potential future callers.
{code}
[cnauroth@ubuntu:pts/0] hadoop-deploy-trunk
> hadoop-3.0.0-SNAPSHOT/bin/hdfs cacheadmin -addDirective -path relative1 -pool
> pool1
Added PathBasedCache entry 1
> hadoop-3.0.0-SNAPSHOT/bin/hdfs cacheadmin -listDirectives
Found 1 entry
ID POOL PATH
1 pool1 /user/cnauroth/relative1
[cnauroth@ubuntu:pts/0] hadoop-deploy-trunk
> hadoop-3.0.0-SNAPSHOT/bin/hdfs cacheadmin -listDirectives -path relative1
Exception in thread "main" java.lang.IllegalArgumentException:
java.net.URISyntaxException: Relative path in absolute URI:
hdfs://localhost:29000relative1/relative1
at org.apache.hadoop.fs.Path.makeQualified(Path.java:470)
at
org.apache.hadoop.hdfs.DistributedFileSystem.listPathBasedCacheDirectives(DistributedFileSystem.java:1639)
at
org.apache.hadoop.hdfs.tools.CacheAdmin$ListPathBasedCacheDirectiveCommand.run(CacheAdmin.java:358)
at org.apache.hadoop.hdfs.tools.CacheAdmin.run(CacheAdmin.java:82)
at org.apache.hadoop.hdfs.tools.CacheAdmin.main(CacheAdmin.java:87)
Caused by: java.net.URISyntaxException: Relative path in absolute URI:
hdfs://localhost:29000relative1/relative1
at java.net.URI.checkPath(URI.java:1804)
at java.net.URI.<init>(URI.java:752)
at org.apache.hadoop.fs.Path.makeQualified(Path.java:467)
... 4 more
{code}
> CacheAdmin -removeDirectives fails on relative paths but -addDirective allows
> them
> ----------------------------------------------------------------------------------
>
> Key: HDFS-5482
> URL: https://issues.apache.org/jira/browse/HDFS-5482
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: tools
> Affects Versions: 3.0.0
> Reporter: Stephen Chu
> Assignee: Colin Patrick McCabe
> Attachments: HDFS-5482.001.patch
>
>
> CacheAdmin -addDirective allows using a relative path.
> However, -removeDirectives will error complaining with
> "java.net.URISyntaxException: Relative path in absolute URI"
> {code}
> [schu@hdfs-c5-nfs ~]$ hdfs cacheadmin -addDirective -path foo -pool schu
> Added PathBasedCache entry 3
> [schu@hdfs-c5-nfs ~]$ hdfs cacheadmin -listDirectives
> Found 1 entry
> ID POOL PATH
> 3 schu /user/schu/foo
> [schu@hdfs-c5-nfs ~]$ hdfs cacheadmin -removeDirectives -path foo
> Exception in thread "main" java.lang.IllegalArgumentException:
> java.net.URISyntaxException: Relative path in absolute URI:
> hdfs://hdfs-c5-nfs.ent.cloudera.com:8020foo/foo
> at org.apache.hadoop.fs.Path.makeQualified(Path.java:470)
> at
> org.apache.hadoop.hdfs.DistributedFileSystem.listPathBasedCacheDirectives(DistributedFileSystem.java:1639)
> at
> org.apache.hadoop.hdfs.tools.CacheAdmin$RemovePathBasedCacheDirectivesCommand.run(CacheAdmin.java:287)
> at org.apache.hadoop.hdfs.tools.CacheAdmin.run(CacheAdmin.java:82)
> at org.apache.hadoop.hdfs.tools.CacheAdmin.main(CacheAdmin.java:87)
> Caused by: java.net.URISyntaxException: Relative path in absolute URI:
> hdfs://hdfs-c5-nfs.ent.cloudera.com:8020foo/foo
> at java.net.URI.checkPath(URI.java:1788)
> at java.net.URI.<init>(URI.java:734)
> at org.apache.hadoop.fs.Path.makeQualified(Path.java:467)
> ... 4 more
> [schu@hdfs-c5-nfs ~]$
> {code}
--
This message was sent by Atlassian JIRA
(v6.1#6144)