geode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jinmei Liao <jil...@pivotal.io>
Subject TypedJson
Date Wed, 28 Nov 2018 22:52:32 GMT
TypedJson is our own implementation of serializing objects into json
strings. It is used to produce a json string when user executes a query
though jmx (DistributedSystemMbean.querydata call). Due to is usage of
org.json and some usage of it causes StackOverFlow that kills the server,
we would like to have it use jackson json instead.

The problem is the output json string would be different as you can see
from some of the examples below:
TypedJson output:
{"result":[["java.lang.Object","java.lang.Object@6842775d"]]}
{"result":[["java.util.HashMap",{"1":["java.lang.String","ONE"],"2":["java.lang.String","TWO"],"3":["java.lang.String","THREE"],"4":["java.lang.String","FOUR"]}]]}
{"result":[["java.math.BigDecimal",20]]}
{"result":[["int[]",[0,1,2]]]}
{"result":[["org.apache.geode.management.internal.cli.json.TypedJsonTest.Currency","DIME"]]}
{"result":[["java.util.ArrayList",{"0":["java.lang.String","ONE"],"1":["java.lang.String","TWO"],"2":["java.lang.String","THREE"]}]]}
{"result":[["org.apache.geode.management.internal.cli.json.TypedJsonTest.EnumContainer",{}]]}

Jackson json output with DefaultTyping enabled
{"result":["java.util.ArrayList",[["java.lang.Object",{}]]]}
{"result":["java.util.ArrayList",[["java.util.HashMap",{"1":"ONE","2":"TWO","3":"THREE","4":"FOUR"}]]]}
{"result":["java.util.ArrayList",[["java.math.BigDecimal",20]]]}
{"result":["java.util.ArrayList",[["[I",[0,1,2]]]]}
{"result":["java.util.ArrayList",[["org.apache.geode.management.internal.cli.json.TypedJsonTest$Currency","DIME"]]]}
{"result":["java.util.ArrayList",[["java.util.ArrayList",["ONE","TWO","THREE"]]]]}
{"result":["java.util.ArrayList",[["org.apache.geode.management.internal.cli.json.TypedJsonTest$EnumContainer",{}]]]}

The only known consumer of these json string is Pulse and any other caller
using jmx queryData call. For Pulse, we can change the display to consume
this new format, but we can't do anything about other jmx client. If we
want to remove this proprietary json serialization, we will need to
deprecate this jmx call and add another one using jackson. Do we know
anyone is consuming the json output coming from a jmx client call?
-- 
Cheers

Jinmei

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message