[ 
https://issues.apache.org/jira/browse/GEODE-6808?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16863547#comment-16863547
 ] 

ASF subversion and git services commented on GEODE-6808:
--------------------------------------------------------

Commit 0e3e20831271d671f1aa6e8941dc450c760ffe6e in geode's branch 
refs/heads/develop from Juan José Ramos
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=0e3e208 ]

GEODE-6808: Restore JSON backward compatibility (#3688)

* GEODE-6808: Revert test changes & add new checks

- Added new unit tests.
- Reverted changes made to tests during the replacement of TypedJson
to be sure backward compatibility is achieved after the implementation
of this ticket.

* GEODE-6808: Restore JSON backward compatibility

Reverted some of the changes made when deleting the in-house JSON
implementation (TypedJson) to the jackson library
('QueryResultFormatter') to restore the backward compatibility.

- Everything is serialized as JSON array with 2 elements: type & value.
- Internal class names are hidden in the JSON document, public
  interfaces are included instead.
- Beans and primitive types only use the standard format when they are
  not being serialized as part of an array, in which case the type is
  ignored as it's already been serialized as ArrayElementType[].

> Backward compatibility broken in DistributedSystemMXBean.queryData
> ------------------------------------------------------------------
>
>                 Key: GEODE-6808
>                 URL: https://issues.apache.org/jira/browse/GEODE-6808
>             Project: Geode
>          Issue Type: Bug
>          Components: jmx, pulse, querying
>            Reporter: Juan José Ramos Cassella
>            Assignee: Juan José Ramos Cassella
>            Priority: Major
>              Labels: GeodeCommons
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> 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|https://geode.apache.org/releases/latest/javadoc/org/apache/geode/management/DistributedSystemMXBean.html#queryData-java.lang.String-java.lang.String-int-]
>  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.
> {code:javascript}
> // 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>");
>   }
> }
> {code}
> 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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to