Package com.couchbase.client.core.node
Class ViewLocator
- java.lang.Object
-
- com.couchbase.client.core.node.RoundRobinLocator
-
- com.couchbase.client.core.node.ViewLocator
-
- All Implemented Interfaces:
Locator
public class ViewLocator extends RoundRobinLocator
TheViewLocator
extends the round-robin locator with some custom checks.
-
-
Constructor Summary
Constructors Constructor Description ViewLocator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
checkServiceNotAvailable(Request<? extends Response> request, ClusterConfig config)
Can be overridden to check if a request should be cancelled immediately that the service is not supported.protected boolean
nodeCanBeUsed(Node node, Request<? extends Response> request, ClusterConfig config)
In addition to checking that the view service is enabled, for view dispatching it is vital that a request is only ever sent to a node which has active primary KV partitions.-
Methods inherited from class com.couchbase.client.core.node.RoundRobinLocator
dispatch
-
-
-
-
Method Detail
-
checkServiceNotAvailable
protected boolean checkServiceNotAvailable(Request<? extends Response> request, ClusterConfig config)
Description copied from class:RoundRobinLocator
Can be overridden to check if a request should be cancelled immediately that the service is not supported.If this method returns false, something MUST be done with the request, or it will time out!
- Overrides:
checkServiceNotAvailable
in classRoundRobinLocator
-
nodeCanBeUsed
protected boolean nodeCanBeUsed(Node node, Request<? extends Response> request, ClusterConfig config)
In addition to checking that the view service is enabled, for view dispatching it is vital that a request is only ever sent to a node which has active primary KV partitions.- Overrides:
nodeCanBeUsed
in classRoundRobinLocator
- Parameters:
node
- the node to check against.request
- the request in scope.config
- the cluster-level config.- Returns:
- true if the node can be used to dispatch the request.
-
-