Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-5482

DistributedFileSystem#listPathBasedCacheDirectives must support relative paths

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.0-alpha1
    • 2.3.0
    • tools
    • None
    • Reviewed

    Description

      CacheAdmin -addDirective allows using a relative path.

      However, -removeDirectives will error complaining with "java.net.URISyntaxException: Relative path in absolute URI"

      [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 ~]$ 
      

      Attachments

        1. HDFS-5482.003.patch
          2 kB
          Colin McCabe
        2. HDFS-5482.002.patch
          2 kB
          Colin McCabe
        3. HDFS-5482.001.patch
          2 kB
          Colin McCabe

        Issue Links

          Activity

            People

              cmccabe Colin McCabe
              schu Stephen Chu
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: