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

HttpFS: LISTSTATUS response is missing HDFS-specific fields

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.0, 3.2.1, 3.1.3
    • Component/s: httpfs
    • Labels:
      None
    • Target Version/s:

      Description

      WebHDFS:

      GET /webhdfs/v1/tmp/?op=LISTSTATUS&user.name=hdfs HTTP/1.1
      
      {
        "FileStatuses": {
          "FileStatus": [
      ...
            {
              "accessTime": 0,
              "blockSize": 0,
              "childrenNum": 0,
              "fileId": 16395,
              "group": "hadoop",
              "length": 0,
              "modificationTime": 1563893395614,
              "owner": "mapred",
              "pathSuffix": "logs",
              "permission": "1777",
              "replication": 0,
              "storagePolicy": 0,
              "type": "DIRECTORY"
            }
          ]
        }
      }
      

      HttpFS:

      GET /webhdfs/v1/tmp/?op=LISTSTATUS&user.name=hdfs HTTP/1.1
      
      {
        "FileStatuses": {
          "FileStatus": [
      ...
            {
              "pathSuffix": "logs",
              "type": "DIRECTORY",
              "length": 0,
              "owner": "mapred",
              "group": "hadoop",
              "permission": "1777",
              "accessTime": 0,
              "modificationTime": 1563893395614,
              "blockSize": 0,
              "replication": 0
            }
          ]
        }
      }
      

      You can see the same LISTSTATUS request to HttpFS is missing 3 fields:

      "childrenNum" (should only be none 0 for directories)
      "fileId"
      "storagePolicy"
      

      The same applies to LISTSTATUS_BATCH, which might be using the same underlying calls to compose the response.

      Root cause:

      toJsonInner didn't serialize the HDFS-specific keys from FileStatus.

      Also may file another Jira to align the order of the keys in the responses.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                smeng Siyao Meng
                Reporter:
                smeng Siyao Meng
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: