Class KeyValueLocator

java.lang.Object
com.couchbase.client.core.node.locate.KeyValueLocator
All Implemented Interfaces:
Locator

public class KeyValueLocator
extends Object
implements Locator
This Locator finds the proper Nodes for every incoming BinaryRequest. Depending on the bucket type used, it either uses partition/vbucket (couchbase) or ketama (memcache) hashing. For broadcast-type operations, it will return all suitable nodes without hashing by key.
Since:
1.0.0
Author:
Michael Nitschinger, Simon Baslé
  • Constructor Details

    • KeyValueLocator

      public KeyValueLocator()
  • Method Details

    • locateAndDispatch

      public void locateAndDispatch​(CouchbaseRequest request, List<Node> nodes, ClusterConfig cluster, 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
      Parameters:
      request - the request to dispatch.
      nodes - the current list of active nodes.
      cluster - the current cluster configuration.
      env - the core environment.
      responseBuffer - the response buffer for potential redistribution.