public class QueryLocator extends Object implements Locator
Constructor and Description |
---|
QueryLocator()
Generates the random initial value for the round robin counter used.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkNode(Node node) |
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.
|
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.
public void locateAndDispatch(CouchbaseRequest request, List<Node> nodes, ClusterConfig config, CoreEnvironment env, com.lmax.disruptor.RingBuffer<ResponseEvent> responseBuffer)
Locator
Given with the environment and node information, the implementation locates the right set of nodes and dispatches the request into them.
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.protected boolean checkNode(Node node)
Copyright © 2018 Couchbase, Inc.. All rights reserved.