Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-6808

Backward compatibility broken in DistributedSystemMXBean.queryData

    XMLWordPrintableJSON

    Details

      Description

      As part of thee efforts to remove TypedJson and move from org.json to Jackson between 1.8.0 and 1.9.0, the JSON string returned by the QueryDataFunction doesn't include the object type anymore within the array (at least for primitive types). The old version used to return results in the form {"result":[["java.lang.String","v"],["java.lang.String","b"]]}, while the new one uses {"result":["v", "b"]}.
      This function is used through DistributedSystemMXBean.queryData, so any user executing queries through JMX and relying on the documented representation to parse the results will fail as soon as they upgrade to 1.9.0.
      Several parsing methods within DataBrowser.js still use these deleted types as well to create an internal representation that is later used to show the results in HTML so, starting with 1.9.0, the query results are always shown as empty.

      // This function creates complete result panel html
      function createHtmlForQueryResults(){
        var memberResults = responseResult.result;
      
        if(memberResults.length > 0){
      
          if(memberResults[0].member != undefined || memberResults[0].member != null){
            //console.log("member wise results found..");      
            for(var i=0; i<memberResults.length; i++){
              //console.log(memberResults[i].member);
              $('#memberAccordion').append(createHtmlForMember(memberResults[i]));
            }
          }else{
            //console.log("cluster level results found..");
            var accordionContentHtml = "";
            accordionContentHtml = createClusterAccordionContentHtml(memberResults);
            var resultHtml = "<div class=\"accordion-content2\">"+ accordionContentHtml +"</div>";
            $('#memberAccordion').append(resultHtml);
          }
        }else{
          $('#memberAccordion').append("<span> No Results Found...</span>");
        }
      }
      

      We need to either re-factor the entire parsing logic to use the new format, or revert the changes to keep using the old format.
      Cheers.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jjramos Juan Ramos
                Reporter:
                jjramos Juan Ramos
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 50m
                  1h 50m