DESCRIPTION

JVMCBC-246: Implement STAT command

Motivation
----------
In order to have access to micro-protocols built atop STAT command, core
library have to support this command.

Modification
------------
Implement request and response classes and allow to override Observable of
AbstractKeyValueRequest to use ReplaySubject for accumulating responses.

Result
------
STAT command accessible through StatRequest

Change-Id: I1f00a42d3bae3f92d7a90a3fce7b7207acb8d899


COMMENTS

author: Cory Peck
date: 2015-09-24 04:37:02.089000000

Uploaded patch set 5.

-------------------------------------
author: Cory Peck
date: 2015-09-24 04:41:34.018000000

Patch Set 5:

Michael, even now it can loose responses. I'm testing with


  core.<StatResponse>send(new StatRequest("key foo 115", bucket.name()))
          .toBlocking()
          .forEach(statResponse -> System.out.printf("%-50s %s\n", statResponse.hostname(), statResponse.key()));

-------------------------------------
author: Estrella Humphrey
date: 2015-09-30 16:02:15.871000000

Patch Set 5:

(4 comments)

Line:502, src/main/java/com/couchbase/client/core/endpoint/kv/KeyValueHandler.java -> maybe simpler way of doing that is to have an AtomicLong in the request, do
if (decrementAndGet() <= 0) { request.observable().onCompleted(); }

Line:507, src/main/java/com/couchbase/client/core/endpoint/kv/KeyValueHandler.java -> I have a doubt about this... shouldn't you let the method use the normal path and return response?

Line:599, src/main/java/com/couchbase/client/core/endpoint/kv/KeyValueHandler.java -> shouldn't the value be read only if request.isSuccess()?

Line:50, src/main/java/com/couchbase/client/core/message/kv/StatRequest.java -> this feels maybe too complicated (AtomicLong instead of AtomicFieldUpdater?)
 having a for(; ; ) makes me uneasy

-------------------------------------
author: Cory Peck
date: 2015-09-30 17:03:25.005000000

Patch Set 5:

(2 comments)

Line:507, src/main/java/com/couchbase/client/core/endpoint/kv/KeyValueHandler.java -> It will publish StatResponse with null key, which is only terminator and does not carry meaning

Line:50, src/main/java/com/couchbase/client/core/message/kv/StatRequest.java -> Done

-------------------------------------
author: Gerrit Code Review
date: 2015-10-13 12:04:12.713000000

Change has been successfully cherry-picked as e3e30fe7aa9aff7b71bc3878613d986166186679

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