public class ViewLocator extends RoundRobinLocator
ViewLocator
extends the round-robin locator with some custom checks.Constructor and Description |
---|
ViewLocator() |
Modifier and Type | Method and 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.
|
dispatch
protected boolean checkServiceNotAvailable(Request<? extends Response> request, ClusterConfig config)
RoundRobinLocator
If this method returns false, something MUST be done with the request or it will time out!
checkServiceNotAvailable
in class RoundRobinLocator
protected boolean nodeCanBeUsed(Node node, Request<? extends Response> request, ClusterConfig config)
nodeCanBeUsed
in class RoundRobinLocator
node
- the node to check against.request
- the request in scope.config
- the cluster-level config.Copyright © 2020 Couchbase, Inc.. All rights reserved.