Class RoundRobinSelectionStrategy

java.lang.Object
com.couchbase.client.core.service.strategies.RoundRobinSelectionStrategy
All Implemented Interfaces:
SelectionStrategy

public class RoundRobinSelectionStrategy
extends Object
implements SelectionStrategy
Selects the Endpoint based on a round-robin selection of connected Endpoints.
Since:
1.3
Author:
Simon Baslé
  • Field Details

    • skip

      protected volatile int skip
  • Constructor Details

    • RoundRobinSelectionStrategy

      public RoundRobinSelectionStrategy()
  • Method Details

    • select

      public Endpoint select​(CouchbaseRequest request, List<Endpoint> endpoints)
      Selects an Endpoint for the given CouchbaseRequest.

      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 interface SelectionStrategy
      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.