Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-682

Unified o3 address parsing for ozonen sh

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.4.0
    • None
    • None

    Description

      For ozone shell command (ozone sh) we have a common method to parse the o3 url (org.apache.hadoop.ozone.web.ozShell.Handler.verifyURI) but there is no common method to parse the volume/bucket/key name from the uri.getPath().

      The error handling/parsing is different in each command handler. For example HDDS-315 fixed a problem with the info key, but we have exactly the same problem with many other endpoints (only the first segment of the key is used).

      As an example:

      hadoop@476486ada939:~$ ozone sh key list /vol1/bucket
      [ ]
      hadoop@476486ada939:~$ ozone sh key put /vol1/bucket/dir1/file NOTICE.txt 
      hadoop@476486ada939:~$ ozone sh key list /vol1/bucket
      [ {
        "version" : 0,
        "md5hash" : null,
        "createdOn" : "Wed, 17 Oct 2018 15:02:31 GMT",
        "modifiedOn" : "Wed, 17 Oct 2018 15:02:32 GMT",
        "size" : 22413,
        "keyName" : "dir1"
      } ]
      

      Here the key name should be dir1/file instead of dir but the keyname is parsed in a wrong way. (same bug which is fixed by HDDS-315 for info key)

      I propose to create a common OzoneAddress class which can parse all the o3://, http:// type of urls, can create the OzoneClient, and provide the parser volume/bucket/key name.

      Attachments

        1. HDDS-682.004.patch
          63 kB
          Marton Elek
        2. HDDS-682.003.patch
          53 kB
          Marton Elek
        3. HDDS-682.002.patch
          53 kB
          Marton Elek
        4. HDDS-682.001.patch
          48 kB
          Marton Elek

        Issue Links

          Activity

            People

              elek Marton Elek
              elek Marton Elek
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: