Class RoundRobinSelectionStrategy
- java.lang.Object
-
- com.couchbase.client.core.service.strategies.RoundRobinSelectionStrategy
-
- All Implemented Interfaces:
SelectionStrategy
public class RoundRobinSelectionStrategy extends Object implements SelectionStrategy
- Since:
- 1.3
- Author:
- Simon Baslé
-
-
Field Summary
Fields Modifier and Type Field Description protected int
skip
-
Constructor Summary
Constructors Constructor Description RoundRobinSelectionStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Endpoint
select(CouchbaseRequest request, List<Endpoint> endpoints)
Selects anEndpoint
for the givenCouchbaseRequest
.protected void
setSkip(int newValue)
Force a value to the skip counter, mainly for testing purposes.
-
-
-
Method Detail
-
select
public Endpoint select(CouchbaseRequest request, List<Endpoint> endpoints)
Selects anEndpoint
for the givenCouchbaseRequest
. If null is returned, it means that no endpoint could be selected and it is up to the calling party to decide what to do next.- Specified by:
select
in interfaceSelectionStrategy
- Parameters:
request
- the input request.endpoints
- all the available endpoints.- Returns:
- the selected endpoint.
-
setSkip
protected void setSkip(int newValue)
Force a value to the skip counter, mainly for testing purposes.- Parameters:
newValue
- the new skip value to apply.
-
-