Class ViewLocator
java.lang.Object
com.couchbase.client.core.node.locate.ViewLocator
- All Implemented Interfaces:
Locator
public class ViewLocator extends Object implements Locator
-
Constructor Summary
Constructors Constructor Description ViewLocator()
Generates the random initial value for the round robin counter used. -
Method Summary
Modifier and Type Method Description protected boolean
checkNode(Node node, CouchbaseBucketConfig config)
void
locateAndDispatch(CouchbaseRequest request, List<Node> nodes, ClusterConfig config, 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
-
ViewLocator
public ViewLocator()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 interfaceLocator
- Parameters:
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
-