DESCRIPTION

JVMCBC-308: Refactor Selection Strategies.

Motivation
----------
This changeset gives some love to the selection strategies and
cleans them up a bit.

Modifications
-------------
The selection strategies have been mildly refactored and also
slightly optimized (and one bug fixed).

 - The Partition strategy now optimizes the common case where
   only one endpoint is available and if this is the case avoids
   the modulo operation. Also a small bug has been fixed where the
   > 0 should actually be >= 0 since 0 is a valid partition.
   Finally since no global state needs to be tracked, the strategy
   is a singleton now.
 - The random strategy now uses a thread local for random which
   provides stronger guarantees when called from more than one
   thread (this is currently not the case, but can be in the future).

Result
------
Strategies refactored, slightly optimized and a small bug fixed.

Change-Id: I72306727c3e744415b2367b9cfb18e10fe0569fc
Reviewed-on: http://review.couchbase.org/61412
Reviewed-by: Estrella Humphrey xxx@xxx.xxx
Tested-by: Natasha Sullivan xxx@xxx.xxx


COMMENTS

author: Gerrit Code Review
date: 2016-03-14 09:23:15.193000000

Change has been successfully cherry-picked as 30cbd084416f033af50075746729ff55d437798d

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