Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-6257

CapacityScheduler REST API produces incorrect JSON - JSON object operationsInfo contains duplicate keys

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.8.1
    • 3.2.0
    • capacityscheduler
    • None
    • Incompatible change, Reviewed
    • The response format of resource manager's REST API endpoint "ws/v1/cluster/scheduler" is optimized, where the "operationInfos" field is converted from a map to list. This change makes the content to be more JSON parser friendly.

    Description

      In response string of CapacityScheduler REST API, scheduler/schedulerInfo/health/operationsInfo have duplicate key 'entry' as a JSON object :

      "operationsInfo":{
        "entry":{"key":"last-preemption","value":{"nodeId":"N/A","containerId":"N/A","queue":"N/A"}},
        "entry":{"key":"last-reservation","value":{"nodeId":"N/A","containerId":"N/A","queue":"N/A"}},
        "entry":{"key":"last-allocation","value":{"nodeId":"N/A","containerId":"N/A","queue":"N/A"}},
        "entry":{"key":"last-release","value":{"nodeId":"N/A","containerId":"N/A","queue":"N/A"}}
      }
      

      To solve this problem, I suppose the type of operationsInfo field in CapacitySchedulerHealthInfo class should be converted from Map to List.

      After convert to List, The operationsInfo string will be:

      "operationInfos":[
        {"operation":"last-allocation","nodeId":"N/A","containerId":"N/A","queue":"N/A"},
        {"operation":"last-release","nodeId":"N/A","containerId":"N/A","queue":"N/A"},
        {"operation":"last-preemption","nodeId":"N/A","containerId":"N/A","queue":"N/A"},
        {"operation":"last-reservation","nodeId":"N/A","containerId":"N/A","queue":"N/A"}
      ]
      

      Attachments

        1. YARN-6257.001.patch
          4 kB
          Tao Yang
        2. YARN-6257.002.patch
          11 kB
          Tao Yang
        3. YARN-6257.003.patch
          11 kB
          Tao Yang
        4. YARN-6257.004.patch
          11 kB
          Tao Yang

        Activity

          People

            Tao Yang Tao Yang
            Tao Yang Tao Yang
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: