DESCRIPTION

JVMCBC-57: DCP functionality

Motivation
----------
In order to be able to implement third-party application integrations,
such as message queues or external indexes, low-level API to DCP
protocol have to be implemented.

Modification
------------
Implemented DCPService, which is allows to listen to the data streams
from Couchbase.

Result
------
DCP implementation, which allows to experiment with DCP integrations.

Change-Id: I50bf350397f3bd6b4ce948212b7762ee0c243ce6


COMMENTS

author: Cory Peck
date: 2015-01-08 22:54:31.389000000

Uploaded patch set 16.

-------------------------------------
author: Cory Peck
date: 2015-01-08 22:55:13.990000000

Patch Set 16: Verified+1

-------------------------------------
author: Estrella Humphrey
date: 2015-01-09 09:45:59.807000000

Patch Set 16:

(5 comments)

Line:33, src/main/java/com/couchbase/client/core/message/dcp/DCPRequest.java -> Is the interface supposed to have a method returning the ConnectionType?
(+ remove ", will")

Line:45, src/main/java/com/couchbase/client/core/message/dcp/ConnectionType.java -> reverse the names?

Line:286, src/main/java/com/couchbase/client/core/endpoint/AbstractGenericHandler.java -> see comment in DcpHandler, I'd prefer an alternative where we can't alter currentRequest

Line:181, src/main/java/com/couchbase/client/core/endpoint/dcp/DCPHandler.java -> do we really need this side effect? it makes things potentially more confusing to be able to mutate currentRequest... can't we just pass the dummy to the handle method?

Line:233, src/main/java/com/couchbase/client/core/endpoint/dcp/DCPHandler.java -> we'll have to think about a way of ensuring the content buffer is cleaned if no one consumes the stream...

-------------------------------------
author: Cory Peck
date: 2015-01-09 11:22:05.378000000

Patch Set 16:

(5 comments)

Line:33, src/main/java/com/couchbase/client/core/message/dcp/DCPRequest.java -> No, it is not. Fixed typo

Line:45, src/main/java/com/couchbase/client/core/message/dcp/ConnectionType.java -> Done

Line:286, src/main/java/com/couchbase/client/core/endpoint/AbstractGenericHandler.java -> I will also put FIXME note

Line:181, src/main/java/com/couchbase/client/core/endpoint/dcp/DCPHandler.java -> There are two cases:

1) Queue is empty: 
In this case outer method picks 'null' as a current request, and it will might lead to NPEs because it does not cover scenario when we receive some packet without request in the queue.

2) Queue is not empty:
In this case we might notify about errors wrong observable in the outer method, so we have to substitute it as soon as we detected that incoming message is not relevant to 'current request'

I will leave explanation above in the code and mark it with FIXME

Line:233, src/main/java/com/couchbase/client/core/endpoint/dcp/DCPHandler.java -> I will leave a TODO item

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