Package org.elasticsearch.client.sniff
Class SnifferBuilder
java.lang.Object
org.elasticsearch.client.sniff.SnifferBuilder
public final class SnifferBuilder
extends java.lang.Object
Sniffer builder. Helps creating a new
Sniffer.-
Field Summary
Fields Modifier and Type Field Description static longDEFAULT_SNIFF_AFTER_FAILURE_DELAYstatic longDEFAULT_SNIFF_INTERVAL -
Method Summary
Modifier and Type Method Description Snifferbuild()Creates theSnifferbased on the provided configuration.SnifferBuildersetNodesSniffer(NodesSniffer nodesSniffer)Sets theNodesSnifferto be used to read hosts.SnifferBuildersetSniffAfterFailureDelayMillis(int sniffAfterFailureDelayMillis)Sets the delay of a sniff execution scheduled after a failure (in milliseconds)SnifferBuildersetSniffIntervalMillis(int sniffIntervalMillis)Sets the interval between consecutive ordinary sniff executions in milliseconds.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
DEFAULT_SNIFF_INTERVAL
public static final long DEFAULT_SNIFF_INTERVAL -
DEFAULT_SNIFF_AFTER_FAILURE_DELAY
public static final long DEFAULT_SNIFF_AFTER_FAILURE_DELAY
-
-
Method Details
-
setSniffIntervalMillis
Sets the interval between consecutive ordinary sniff executions in milliseconds. Will be honoured when sniffOnFailure is disabled or when there are no failures between consecutive sniff executions.- Throws:
java.lang.IllegalArgumentException- if sniffIntervalMillis is not greater than 0
-
setSniffAfterFailureDelayMillis
Sets the delay of a sniff execution scheduled after a failure (in milliseconds) -
setNodesSniffer
Sets theNodesSnifferto be used to read hosts. A default instance ofElasticsearchNodesSnifferis created when not provided. This method can be used to change the configuration of theElasticsearchNodesSniffer, or to provide a different implementation (e.g. in case hosts need to taken from a different source). -
build
Creates theSnifferbased on the provided configuration.
-