DESCRIPTION

JVMCBC-446: Speed up end of row parsing for N1QL parser.

Motivation
----------
When parsing N1QL Query rows in a streaming fashion, the
row parser needs to look for start { and end } properly
to find the next row to pass on into the observable.

When the documents are huge the current approach scans
the full buffer over and over again which is inefficient
and can be sped up.

Modifications
-------------
In QueryHandler#parseQueryRows reuse the ClosingPositionBufProcessor and
restart the scan when when it ends at the last run with
int forEachByte(int index, int length, ByteBufProcessor processor).

Result
------
It brings the performance on par with the query launched from the
console on big documents, on certain documents even shaving off
seconds of processing time.

Change-Id: I89069293cc42beae20c90fcb5464173009e91d0c


COMMENTS

author: Natasha Sullivan
date: 2017-08-08 14:53:35.823000000

Uploaded patch set 2.

-------------------------------------
