Class KeyValueLocator

  • All Implemented Interfaces:

    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.
    Michael Nitschinger, Simon Baslé
    • Constructor Detail

      • KeyValueLocator

        public KeyValueLocator()
    • Method Detail

      • 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
        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.