Package org.elasticsearch.discovery.zen
Class NodesFaultDetection
- java.lang.Object
-
- org.elasticsearch.discovery.zen.FaultDetection
-
- org.elasticsearch.discovery.zen.NodesFaultDetection
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class NodesFaultDetection extends FaultDetection
A fault detection of multiple nodes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNodesFaultDetection.Listenerstatic classNodesFaultDetection.PingRequest
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPING_ACTION_NAME-
Fields inherited from class org.elasticsearch.discovery.zen.FaultDetection
clusterName, CONNECT_ON_NETWORK_DISCONNECT_SETTING, connectionListener, connectOnNetworkDisconnect, PING_INTERVAL_SETTING, PING_RETRIES_SETTING, PING_TIMEOUT_SETTING, pingInterval, pingRetryCount, pingRetryTimeout, REGISTER_CONNECTION_LISTENER_SETTING, registerConnectionListener, threadPool, transportService
-
-
Constructor Summary
Constructors Constructor Description NodesFaultDetection(Settings settings, ThreadPool threadPool, TransportService transportService, java.util.function.Supplier<ClusterState> clusterStateSupplier, ClusterName clusterName)
-
Method Summary
Modifier and Type Method Description voidaddListener(NodesFaultDetection.Listener listener)voidclose()java.util.Set<DiscoveryNode>getNodes()Gets the current set of nodes involved in node fault detection.protected voidhandleTransportDisconnect(DiscoveryNode node)voidremoveListener(NodesFaultDetection.Listener listener)voidsetLocalNode(DiscoveryNode localNode)NodesFaultDetectionstop()stops all pingingvoidupdateNodesAndPing(ClusterState clusterState)make sure that nodes in clusterState are pinged.
-
-
-
Field Detail
-
PING_ACTION_NAME
public static final java.lang.String PING_ACTION_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NodesFaultDetection
public NodesFaultDetection(Settings settings, ThreadPool threadPool, TransportService transportService, java.util.function.Supplier<ClusterState> clusterStateSupplier, ClusterName clusterName)
-
-
Method Detail
-
setLocalNode
public void setLocalNode(DiscoveryNode localNode)
-
addListener
public void addListener(NodesFaultDetection.Listener listener)
-
removeListener
public void removeListener(NodesFaultDetection.Listener listener)
-
getNodes
public java.util.Set<DiscoveryNode> getNodes()
Gets the current set of nodes involved in node fault detection. NB: For testing purposes.
-
updateNodesAndPing
public void updateNodesAndPing(ClusterState clusterState)
make sure that nodes in clusterState are pinged. Any pinging to nodes which are not part of the cluster will be stopped
-
stop
public NodesFaultDetection stop()
stops all pinging
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classFaultDetection
-
handleTransportDisconnect
protected void handleTransportDisconnect(DiscoveryNode node)
-
-