DESCRIPTION

JCBC-749: Bringing includeDocs back to 2.x (2.2.0)

Motivation
----------
The 1.x SDK provides "includeDocs" as part of the query, which will trigger a
"bulkGet" behind the scenes. In the 2.x SDK one can easily simulate that with
flatMap and bulk operations, but it makes it necessary to fall back to
async operations.

If someone is using the sync API, we need to make sure to get the best
performance. Currently, the only option is to call .document() on every
row, which is slow since it does a serial get call for every row.

Modifications
-------------
This changeset adds the "includeDocs" query option to the builder. In addition,
the logic checks if it is enabled and if so, it flatMaps the documents through
implict get() calls in the async flow, leading to very efficient bulk calls
even on the blocking API.

The actual API does not change on the rows, because internally it lazily
evaluates if the document is already set or not, which means that the
old behaviour is still there too.

Result
------
Very efficient document loading, even on the blocking API. It can also
be used on the async API for convenience.

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


COMMENTS

author: Tate Garrett
date: 2015-04-17 16:50:07.816000000

Change has been successfully cherry-picked as fa5967a2274c6247f27ed3b45ca2b4432ac9183d

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