DESCRIPTION

JVMCBC-93: Flexible endpoint pooling.

Motivation
----------
The previous service implementation did only support a fixed number of endpoints against
every node. This had drawbacks:

	- Endpoints (and therefore sockets) are opened for services which do not need
	  to be open at any times. This holds true for Config (8091) and DCP (11210)
	  services. Opening sockets to all nodes in the cluster when they are not
	  utilized is wasteful.
	- Cases where the number of endpoints must be more than the fixed number are
	  not covered properly and were implemented with some workarounds (for streaming
	  responses in the Config service).

The new implementation, in addition to providing the fixed size service for KeyValue,
Query and Views, provides an "on demand" service which opens and closes endpoints
for incoming requests on demand. When such a "transient" endpoint finishes doing
a single req/res cycle, it disposes itself.

This provides better resource utilization and allows for a more flexible service
architecture.

Modifications
-------------
In order to facilitate such a change, some parts had to be reworked:

	1) The Service implementation has been split out into a common parent and then
	   the two implementations (pooled and on demand).
	2) Endpoints now know if they are transient and if so they disconnect after one
	   req/res cycle and will be disposed.
	3) A new "IDLE" state has been added to the lifecycle states in order to
	   semantically represent a service which has no attached endpoints at a given
	   time.

Tests have been added for the service to show their basic functionality, although this
can be expanded in the future for more complex state transition tests.

Result
------
A more flexible way of pooling endpoints in services, providing better resource
utilization and getting rid of the "hack" when more endpoints are needed than
configured on the environment for config streaming endpoints.

Change-Id: Id93b3d0c4efbdb20875ec0ef3a7509037bb6add5


COMMENTS

author: Gerrit Code Review
date: 2015-01-26 16:57:59.636000000

The change could not be merged due to a path conflict.

Please rebase the change locally and upload the rebased commit for review.

-------------------------------------
author: Natasha Sullivan
date: 2015-01-26 17:00:10.022000000

Uploaded patch set 6.

-------------------------------------
author: Estrella Humphrey
date: 2015-01-26 17:02:29.631000000

Patch Set 6: Code-Review+2

-------------------------------------
author: Natasha Sullivan
date: 2015-01-26 17:05:04.457000000

Patch Set 6: Verified+1

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