DESCRIPTION

JVMCBC-358: Round Robin Endpoint selection strategy

Motivation:
-----------
Current endpoint selection strategy is either `Random` or based on
`Partition`. It was observed that random selection could lead to a same
endpoint being chosen several times in a row, and with long running
requests (like N1QL queries) this can add up. Thus a round robin
selection is probably a better fit.

Modifications:
--------------
Added a new `SelectionStrategy`, the `RoundRobinSelectionStrategy`.
The strategy maintains an internal volatile int "skip" counter. When
wrapping around due to overflow, the counter is reset to 0.

Made `QueryService` use that strategy for its endpoints.

Results:
--------
Fairer endpoint selection strategy can now be used.

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


COMMENTS

author: Gerrit Code Review
date: 2016-08-24 13:45:07.792000000

Change has been successfully cherry-picked as f76a739978ae9ddec227da89b9b8505fb7bae57d by Estrella Humphrey

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