Package org.elasticsearch.client
Class PreferHasAttributeNodeSelector
- java.lang.Object
-
- org.elasticsearch.client.PreferHasAttributeNodeSelector
-
- All Implemented Interfaces:
NodeSelector
public final class PreferHasAttributeNodeSelector extends java.lang.Object implements NodeSelector
BothPreferHasAttributeNodeSelectorandHasAttributeNodeSelectorwill work the same if there is aNodewith particular attribute in the attributes, butPreferHasAttributeNodeSelectorwill select anotherNodes even if there is noNodewith particular attribute in the attributes.
-
-
Field Summary
-
Fields inherited from interface org.elasticsearch.client.NodeSelector
ANY, SKIP_DEDICATED_MASTERS
-
-
Constructor Summary
Constructors Constructor Description PreferHasAttributeNodeSelector(java.lang.String key, java.lang.String value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)inthashCode()voidselect(java.lang.Iterable<Node> nodes)Select theNodes to which to send requests.java.lang.StringtoString()
-
-
-
Method Detail
-
select
public void select(java.lang.Iterable<Node> nodes)
Description copied from interface:NodeSelectorSelect 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 blacklisted by previous errors. If the selector removes all nodes from the list or if there aren't any living nodes then the
RestClientwill call this method with a list of "dead" nodes.Implementers should not rely on the ordering of the nodes.
- Specified by:
selectin interfaceNodeSelector
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-