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 Node
s 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 Summary
Constructors Constructor Description KeyValueLocator()
-
Method Summary
Modifier and Type Method Description void
locateAndDispatch(CouchbaseRequest request, List<Node> nodes, ClusterConfig cluster, CoreEnvironment env, com.lmax.disruptor.RingBuffer<ResponseEvent> responseBuffer)
Given with the environment and node information, the implementation locates the right set of nodes and dispatches the request into them.
-
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 interfaceLocator
- 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.
-