Package org.elasticsearch.client
Interface NodeSelector
- All Known Implementing Classes:
HasAttributeNodeSelector
,PreferHasAttributeNodeSelector
public interface NodeSelector
Selects nodes that can receive requests. Used to keep requests away
from master nodes or to send them to nodes with a particular attribute.
Use with
RestClientBuilder.setNodeSelector(NodeSelector)
.-
Field Summary
Fields Modifier and Type Field Description static NodeSelector
ANY
Selector that matches any node.static NodeSelector
SKIP_DEDICATED_MASTERS
Selector that matches any node that has metadata and doesn't have themaster
role OR it has the datadata
role. -
Method Summary
-
Field Details
-
ANY
Selector that matches any node. -
SKIP_DEDICATED_MASTERS
Selector that matches any node that has metadata and doesn't have themaster
role OR it has the datadata
role.
-
-
Method Details
-
select
Select theNode
s to which to send requests. This is called with a mutableIterable
of Nodes in the order that the rest client would prefer to use them and implementers should remove nodes from the that should not receive the request. Implementers may iterate the nodes as many times as they need.This may be called twice per request: first for "living" nodes that have not been blacklisted by previous errors. If the selector removes all nodes from the list or if there aren't any living nodes then the
RestClient
will call this method with a list of "dead" nodes.Implementers should not rely on the ordering of the nodes.
-