Closed glassfishrobot closed 7 years ago
Reported by kchung
@m0mus said: It was fixed by adding skip* methods to JsonParser.
Issue-Links: blocks JSON_PROCESSING_SPEC-66
Was assigned to kchung
This issue was imported from java.net JIRA JSON_PROCESSING_SPEC-70
Marked as fixed on Wednesday, March 8th 2017, 3:23:34 am
For our purpose, big JSON data are those whose object model are too big to fit the available memory. Currently, most of JSONP API's (e.g. JsonArray) requires that whole JSON object model be in memory. The only available API for processing big JSON seems to be JsonParser, but that is too low level to be useful.
Since Java stream operations is a useful tool to use for querying, filtering and processing JSON data, we should explore ways for constructing streams from JsonParse events. Of course the objects in the stream should be high level enough to be useful, like elements of an array or object. Streams should also be implemented in such a way that only the elements that take part in the stream operations need to be in memory. For instance, those elements that are filtered out can be discarded.
Not sure at this stage if it's best to add API's to JsonParser to create stremas, or we'll need new classes/interfaces that works with JsonParser. In any case, we probably need to add some features in JsonParser (e.g. skip to the end of an array) that will be useful when processing big JSON.
Affected Versions
[1.1]