DESCRIPTION

JCBC-795: Named Prepared Statement support

Motivation:
-----------
The query team introduce the possibility to name prepared statements.
Instead of keeping the whole Query Plan, one can simply send the name
which is a way lighter payload.
If not given one in the "PREPARE..." statement, the server will generate
a name and cache the plan as well.

Modifications
-------------
This change gets rid of the QueryPlan class, replaced by PreparedPayload
which only stores the name and the original statement (for future retry
support).

AsyncQueryResult's info is now a stream of QueryMetrics directly in the
constructor signature.

Added a DigestUtils class that can encode a String in SHA1, used as the
identifier for a given statement (low chances of collisions between two
well-formed N1QL statements).

Tests have been added and amended, but integration testing is not
entirely possible while there's no mean of removing a prepared statement
from the server's cache.

Results
-------
All tests pass, prepared statements are referenced by name instead of
sending the whole execution plan over the wire.

Change-Id: Iae5d07aa91828501a0fd1c97983a293bf2568854


COMMENTS

author: Estrella Humphrey
date: 2015-07-09 15:07:22.830000000

Uploaded patch set 3.

-------------------------------------
author: Estrella Humphrey
date: 2015-07-09 15:34:25.382000000

Patch Set 3: Verified+1

note on verified: had an error while integration testing, resolved by restarting the server. See https://issues.couchbase.com/browse/MB-15619

-------------------------------------
author: Tate Garrett
date: 2015-07-22 09:29:28.368000000

Change has been successfully cherry-picked as a9f22259c94dd19f7eaffadd5c979d75018fa80c

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