DESCRIPTION

JCBC-814: Refactoring query-related code out of AsyncBucket

Motivation:
-----------
In CouchbaseAsyncBucket, the code relative to executing N1QL queries is
starting to take too much space, becoming more difficult to maintain.
Externalize all the actual implementation into a separate class.

Modifications:
--------------
Refactored private methods queryRaw and queryPrepared as well as actual
implementation for prepare into a separate class QueryExecutor.

Separated executing a prepared query and executing it with retry so both
options are available to power users.

The QueryExecutor is accessible through a CouchbaseAsyncBucket protected
method (that could be used for mocking it).

Fixed unit tests where a PREPARE is asserted.

Environment is also accessible from Bucket.

Results
-------
Code for query execution is isolated and will be easier to find and to
maintain. Retry behavior can be implemented by the client through using
QueryExecutor.preparedQuery instead of preparedQueryWithRetry.

Unit tests and query integration tests pass.

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


COMMENTS

author: Tate Garrett
date: 2015-07-23 07:30:44.917000000

Change has been successfully cherry-picked as 10cdefebba1432a46662e6107903585570c7d7a8

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