Skip to content
Latest commit cb6097d @great great committed with simonbasle 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: Simon Baslé <simon@couchbase.com>
Tested-by: Simon Baslé <simon@couchbase.com>
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Something went wrong with that request. Please try again.