DESCRIPTION

JCBC-910: Add includeDocs variant to force order of get items

Motivation
----------
View query result order can be randomly mixed when includeDocs is true,
if one of the documents takes longer to be retrieved (because of the
efficient but unordered flatMap).

Sometimes it should be consistent, even if that means a slight overhead
on performance or memory.

Modifications
-------------
If includeDocs isn't used, concatMap can be used instead of flatMap (the
ordering is correct and the impact is negligible).

Added includeDocsOrdered variants that will enforce the row order. This
uses the experimental concatMapEager operator that fires all get request
immediately (instead of serially with a concatMap) and then buffers out
of order responses to drain them in correct order as soon as it becomes
possible.

This usage is flagged through the 'isOrderRetained()' method.

Added unit tests that validate this behavior.

Result
------
A user can better tune view query result order consistency.

Change-Id: I3ca3998f13d40051297c228aa64661c785e2a5d1
Reviewed-on: http://review.couchbase.org/59250
Reviewed-by: Estrella Humphrey xxx@xxx.xxx
Tested-by: Estrella Humphrey xxx@xxx.xxx
Reviewed-by: Natasha Sullivan xxx@xxx.xxx


COMMENTS

author: Tate Garrett
date: 2016-02-05 16:20:28.845000000

Change has been successfully cherry-picked as cb6097de716752215959377f6a0618d747d664c7

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