Class QueryLocator

All Implemented Interfaces:
Direct Known Subclasses:
AnalyticsLocator, SearchLocator

public class QueryLocator
extends Object
implements Locator
  • Constructor Details

    • QueryLocator

      public QueryLocator()
      Generates the random initial value for the round robin counter used. This will generate a random number between 0 and 1023 which is probably enough distribution to not make all queries hit the same first server all the time.
  • Method Details

    • locateAndDispatch

      public void locateAndDispatch​(CouchbaseRequest request, List<Node> nodes, ClusterConfig config, CoreEnvironment env, com.lmax.disruptor.RingBuffer<ResponseEvent> responseBuffer)
      Description copied from interface: Locator
      Given with the environment and node information, the implementation locates the right set of nodes and dispatches the request into them.
      Specified by:
      locateAndDispatch in interface Locator
      request - the request to dispatch.
      nodes - the current list of active nodes.
      config - the current cluster configuration.
      env - the core environment.
      responseBuffer - the response buffer for potential redistribution.
    • checkNode

      protected boolean checkNode​(Node node)