Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-7240 Scaling HDFS
  3. HDFS-12389

Ozone: oz commandline list calls should return valid JSON format output

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • HDFS-7240
    • HDFS-7240
    • ozone
    • Reviewed

    Description

      At present the outputs of listVolume, listBucket and listKey are hard to parse, for example following call

      ./bin/hdfs oz -listVolume http://localhost:9864 -user wwei
      

      lists all volumes in my cluster and it returns

      {
          "version" : 0,
          "md5hash" : null,
          "createdOn" : "Mon, 04 Sep 2017 03:25:22 GMT",
          "modifiedOn" : "Mon, 04 Sep 2017 03:25:22 GMT",
          "size" : 10240,
          "keyName" : "key-0-22381",
          "dataFileName" : null
        }
       {  
          "version" : 0,
          "md5hash" : null,
          "createdOn" : "Mon, 04 Sep 2017 03:25:22 GMT",
          "modifiedOn" : "Mon, 04 Sep 2017 03:25:22 GMT",
          "size" : 10240,
          "keyName" : "key-0-22381",
          "dataFileName" : null
        }
        ...
      

      this is not a valid JSON format output hence it is hard to parse in clients' script for further interactions. Propose to reformat them to valid JSON data.

      Attachments

        1. HDFS-12389-HDFS-7240.001.patch
          20 kB
          Weiwei Yang
        2. HDFS-12389-HDFS-7240.002.patch
          20 kB
          Weiwei Yang
        3. json_output_test.log
          2 kB
          Weiwei Yang

        Activity

          People

            cheersyang Weiwei Yang
            cheersyang Weiwei Yang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: