Interface NodeSelector
-
public interface NodeSelectorSelects nodes that can receive requests. Used to keep requests away from cluster-manager nodes or to send them to nodes with a particular attribute.
-
-
Field Summary
Fields Modifier and Type Field Description static NodeSelectorANYSelector that matches any node.static NodeSelectorSKIP_DEDICATED_CLUSTER_MANAGERSSelector that matches any node that has metadata and doesn't have thecluster_managerrole OR it has the datadatarole.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidselect(java.lang.Iterable<Node> nodes)Select theNodes to which to send requests.
-
-
-
Field Detail
-
ANY
static final NodeSelector ANY
Selector that matches any node.
-
SKIP_DEDICATED_CLUSTER_MANAGERS
static final NodeSelector SKIP_DEDICATED_CLUSTER_MANAGERS
Selector that matches any node that has metadata and doesn't have thecluster_managerrole OR it has the datadatarole.
-
-
Method Detail
-
select
void select(java.lang.Iterable<Node> nodes)
Select theNodes to which to send requests. This is called with a mutableIterableof 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 denylisted by previous errors. If the selector removes all nodes from the list or if there aren't any living nodes then the
ApacheHttpClient5Transportwill call this method with a list of "dead" nodes.Implementers should not rely on the ordering of the nodes.
- Parameters:
nodes- theNodes targeted for the sending requests
-
-