DESCRIPTION

JCBC-921: Implement builder-based API for subdoc

Motivation:
-----------
The common SDK API that was agreed upon for the sub-document feature is
one based on builders. This allows you to fluently describe what lookups
or mutations you want to perform, and the single operation cases can
still be optimized at execution by choosing the right single message to
send to the server.

Modifications:
--------------
Subdoc API at the bucket level is limited to two methods that just take
the key of the document to target: lookupIn and mutateIn. These each
return an adequate builder that can be used to describe either the
lookups or mutations to be performed.

LookupInBuilder uses AsyncLookupInBuilder under the cover, and similarly
MutateInBuilder blocks on AsyncMutateInBuilder. In order to trigger the
operations, one must call doLookup() or doMutate() on the builders.

ExtendDirection has been removed (builder methods are separated for the
two directions).

All results are represented as a DocumentFragment, that allows to get
a result by index or path of the original operation. If a lookup wasn't
successful, calling content() on its path or index will throw the
exception that corresponds to the error.

Most of the subdoc code now is contained in the two async builders and
tests have been updated for the new API.

Result:
-------
Subdocument lookups and mutations can easily be expressed through a
builder-based API.

The API is extensively tested with integration tests.

Change-Id: I0038af9b543464832a15cd204dad20c83ab745eb


COMMENTS

author: Estrella Humphrey
date: 2016-02-19 16:59:40.361000000

Uploaded patch set 5.

-------------------------------------
author: Tate Garrett
date: 2016-02-23 18:39:14.344000000

Change has been successfully cherry-picked as 8ccf14088a27669ff29852cf88cd37b2eb471611

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