DESCRIPTION

JCBC-388: Rewrite View Connection Management

This changeset rewrites the connection management of the view layer
by utilizing newer mechanisms in apache httpcore nio.

	- It uses a built-in pooling mechanism
	- Reduces the amount of threads used to a minimum
	- Fixes severe connection issues under failover conditions
	- Massively reduces the amount of code needed
	- Streamlines the reconfiguration process in ViewConnection
	- Makes the worker threads and connection size configurable
	- Handle connection lease on rebalance out
	- Adds better testing for the provided functionality
	- Writes the HTTP_HOST automatically to avoid costly DNS
	  lookups, fixing JCBC-151.

Change-Id: Ie78466a0ec7e70118d1ed874684f690887ffb688


COMMENTS

author: Natasha Sullivan
date: 2013-12-19 06:56:46.471000000

Uploaded patch set 12.

-------------------------------------
author: Andreas Short
date: 2013-12-30 07:30:39.514000000

Patch Set 12: Code-Review-1

(10 comments)

-1 just for the version and line wrapping, but otherwise it looks really good!

Line:56, src/main/java/com/couchbase/client/http/ViewPool.java -> This last sentence is more for a comment, than for doc comments, but no big deal.

Line:110, src/main/java/com/couchbase/client/CouchbaseConnectionFactoryBuilder.java -> The way this works, you can set it later after it's initially set.  do you mean to do that?  It's a nitpick.

Line:180, src/main/java/com/couchbase/client/http/HttpResponseCallback.java -> Might be nice to have debug level logging here, but not required.

Line:200, src/main/java/com/couchbase/client/http/HttpResponseCallback.java -> same here.

Line:18, /COMMIT_MSG -> Should be "Handles connection lease"

Line:154, src/main/java/com/couchbase/client/ViewConnection.java -> It'd be better to get the exact version in here.  Or at least from something common with what I reviewed yesterday.

Line:194, src/main/java/com/couchbase/client/ViewConnection.java -> Is this what would happen if it was a memcached bucket?  That may be a test case to consider.

Line:204, src/main/java/com/couchbase/client/ViewConnection.java -> Not a big deal, but might it be better to throw from here rather than log?

Line:311, src/main/java/com/couchbase/client/ViewConnection.java -> Might be nice to number these, but not required.  If you do, an atomic integer for the threads as created would be good.

Line:332, src/main/java/com/couchbase/client/ViewConnection.java -> weird line wrapping?

-------------------------------------
author: Natasha Sullivan
date: 2013-12-30 07:38:37.874000000

Patch Set 12:

(8 comments)

Line:110, src/main/java/com/couchbase/client/CouchbaseConnectionFactoryBuilder.java -> hmm can you elaborate? Do you mean changing it after construction or more than once?

Line:180, src/main/java/com/couchbase/client/http/HttpResponseCallback.java -> sounds good

Line:200, src/main/java/com/couchbase/client/http/HttpResponseCallback.java -> yup

Line:154, src/main/java/com/couchbase/client/ViewConnection.java -> oh jeah, let's open a separate ticket for that.

Line:194, src/main/java/com/couchbase/client/ViewConnection.java -> a memcached bucket shouldn't even get here, it should fail in the CouchbaseClient directly, saying its not supported.

Good thought on the test case!

Line:204, src/main/java/com/couchbase/client/ViewConnection.java -> that's copied from the old behaviour, do you think its worth to change it?

Line:311, src/main/java/com/couchbase/client/ViewConnection.java -> We only have one of these, the workers are numbered - or do you mean a static numbering for N CouchbaseClient objects?

Line:332, src/main/java/com/couchbase/client/ViewConnection.java -> woops :)

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