HPCC-8435 Implement JSON Pull Parser and PTree creation

Parsing and creating PTrees from JSON is needed for several
upcoming JSON integration items.  This implements a PullReader
and a BufferReader, as well as createPTreeFromJSON Functions.

This implementation emulates the style and practice of the current
XML parsers.  It also sticks to the existing parser interfaces
completely future enhancements could be made that would improve those
interfaces to benefit more from JSON data type knowledge.  Especially
to improve symmetry between building a PTree and serializing back
to JSON.

While the parsers support full JSON naming syntax, JSON supports
object names that cannot currently be supported as property trees.
Creating a property tree from such JSON will throw a PTree exception.

The general philosophy for the pull parser has been that each call to
IPulXMLReader::next() will result in one event (or error).  Further
action after an event is minimized.  The event handler should be able
to abort immediately without further events or syntax based errors.

Signed-off-by: Anthony Fishbeck <Anthony.Fishbeck@lexisnexis.com>
HPCC-8435 Common up JSON and XML Pull Parser code

Signed-off-by: Anthony Fishbeck <Anthony.Fishbeck@lexisnexis.com>
HPCC-8435 PTree Reader interface names should not reference XML

Signed-off-by: Anthony Fishbeck <Anthony.Fishbeck@lexisnexis.com>
HPCC-8828 Add new metrics to Roxie

Various minor bug fixes and performance enhancements in Roxie metrics
reporting.

Add some global metrics to supplement the ones taht are reported per query or
per query class.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
HPCC-8435 Clean up hierarchy of PTreeReader init and reset methods

Signed-off-by: Anthony Fishbeck <Anthony.Fishbeck@lexisnexis.com>
HPCC-8828 Add new metrics to Roxie

Some changes in response to code review. Use accessor functions rather than
global variables.

Also looked a little closer at which metrics it is sensible to reset.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Merge pull request #4064 from richardkchapman/roxie-stats

HPCC-8828 Add new metrics to Roxie

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Merge remote-tracking branch 'origin/candidate-3.10.x'

Conflicts:
	esp/services/ws_fs/ws_fsService.cpp
	esp/services/ws_workunits/ws_workunitsService.cpp

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Merge pull request #3820 from afishbeck/json_ptree

HPCC-8435 Implement JSON Pull Parser and PTree creation

Reviewed-By: Jake Smith <jake.smith@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
HPCC-8925 XMLDECODE decodes & to nothing

Various issues with the way XMLDECODE (and xml read) handle invalid escape
sequences.

1. XMLDECODE should be leave invalid escape sequences unchanged. At present
the unicode version strips them (sometimes) and the ascii version throws an
exception
2. Potential reads off the end of the input string in both cases
3. Incorrectly accepting upper-case variants of escape sequences
4. Unicode version was missing &nbsp. Strictly speaking that is an HTML escape
sequence not an XML one, but since the ascii version accepted it the unicode
one should too.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
hpcc-8905 Fix minisort OOM and deadlock

Various problems causing mini sort to miscalculate in-memory
size, run out of memory and potentially deadlock

Signed-off-by: Jake Smith <jake.smith@lexisnexis.com>
Merge pull request #4079 from richardkchapman/xmldecode

HPCC-8925 XMLDECODE decodes & to nothing

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Merge pull request #4082 from jakesmith/hpcc-8905-master

HPCC-8905 Fix minisort OOM and deadlock

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
HPCC-8934 Add support for huge pages to roxiemem

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>