DESCRIPTION

JVMCBC-441: Add a CoreSendHook

Motivation
----------
Right now it is not possible to hook in before we "send" the request
into the ringbuffer, allowing to introspect the request and also
to potentially alternate the observable returned to the upper layers.

Modifications
-------------
This changeset makes it possible to hook into the send method, configurable
via a hook through the environment. The tuple returned allows to either
pass through or modify the original request and/or the original response.

Result
------
It is now possible to optionally hook the send method before the request
is put into the ringbuffer.

Change-Id: I7501f1a3cc93275e26e7644248b0261feecb09aa


COMMENTS

author: Natasha Sullivan
date: 2017-08-11 13:26:28.869000000

Patch Set 6: Patch Set 5 was rebased

-------------------------------------
author: Hugo Blankenship
date: 2017-08-11 13:29:54.015000000

Patch Set 6:

Build Started http://sdkbuilds.sc.couchbase.com/job/couchbase-jvm-core-test/29/

-------------------------------------
author: Hugo Blankenship
date: 2017-08-11 13:31:35.763000000

Patch Set 6: Verified+1

Build Successful 

http://sdkbuilds.sc.couchbase.com/job/couchbase-jvm-core-test/29/ : SUCCESS

-------------------------------------
author: Natasha Sullivan
date: 2017-08-16 07:07:26.900000000

Patch Set 6:

(1 comment)

Line:220, src/main/java/com/couchbase/client/core/CouchbaseCore.java -> I agree, I was thinking about reducing the allocations here by default as well - .. I'll clean that up too

-------------------------------------
author: Cory Peck
date: 2017-08-14 08:55:32.167000000

MISMATCHED INLINE COMMENT
Line:220, src/main/java/com/couchbase/client/core/CouchbaseCore.java -> I wonder how this implementation will compare to one, where the hook allowed return null or some blank static value Tuple2.EMPTY, which allow hook to signal that the caller should use original values.

So branching here versus unneeded allocations by default.

Or even allow to keep the callback null, and check it before calling.

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