Class NetworkDisruption
java.lang.Object
org.elasticsearch.test.disruption.NetworkDisruption
- All Implemented Interfaces:
ServiceDisruptionScheme
Network disruptions are modeled using two components:
1) the
NetworkDisruption.DisruptedLinks represents the links in the network that are to be disrupted
2) the NetworkDisruption.NetworkLinkDisruptionType represents the failure mode that is to be applied to the links-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCreates two partitions with symmetric failures and a bridge node that can connect to both of the partitionsstatic classRepresents a set of nodes with connections between nodes that are to be disruptedstatic classstatic classSimulates slow or congested network.static classAbstract class representing various types of network disruptions.static classCreates two partitions with symmetric failures -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected InternalTestClusterstatic final NetworkDisruption.NetworkLinkDisruptionTypeSimulates a network disconnect.static final NetworkDisruption.NetworkLinkDisruptionTypeSimulates an unresponsive target node by dropping requests sent from source to target node. -
Constructor Summary
ConstructorsConstructorDescriptionNetworkDisruption(NetworkDisruption.DisruptedLinks disruptedLinks, NetworkDisruption.NetworkLinkDisruptionType networkLinkDisruptionType) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyToCluster(InternalTestCluster testCluster) voidapplyToNode(String node, InternalTestCluster testCluster) static voidEnsures that all nodes in the cluster are connected to each other.voidensureHealthy(InternalTestCluster testCluster) ensures the cluster is healthy after the disruptionprotected voidensureNodeCount(InternalTestCluster testCluster) org.elasticsearch.core.TimeValuevoidremoveAndEnsureHealthy(InternalTestCluster testCluster) voidremoveFromCluster(InternalTestCluster testCluster) voidremoveFromNode(String node1, InternalTestCluster testCluster) voidvoidvoidtoString()
-
Field Details
-
cluster
-
activeDisruption
protected volatile boolean activeDisruption -
DISCONNECT
Simulates a network disconnect. Sending a request from source to target node throws aConnectTransportException. -
UNRESPONSIVE
Simulates an unresponsive target node by dropping requests sent from source to target node.
-
-
Constructor Details
-
NetworkDisruption
public NetworkDisruption(NetworkDisruption.DisruptedLinks disruptedLinks, NetworkDisruption.NetworkLinkDisruptionType networkLinkDisruptionType)
-
-
Method Details
-
getDisruptedLinks
-
getNetworkLinkDisruptionType
-
applyToCluster
- Specified by:
applyToClusterin interfaceServiceDisruptionScheme
-
removeFromCluster
- Specified by:
removeFromClusterin interfaceServiceDisruptionScheme
-
removeAndEnsureHealthy
- Specified by:
removeAndEnsureHealthyin interfaceServiceDisruptionScheme
-
ensureHealthy
ensures the cluster is healthy after the disruption -
ensureFullyConnectedCluster
Ensures that all nodes in the cluster are connected to each other. Some network disruptions may leave nodes that are not the master disconnected from each other.NodeConnectionsServicewill eventually reconnect but it's handy to be able to ensure this happens faster -
ensureNodeCount
-
applyToNode
- Specified by:
applyToNodein interfaceServiceDisruptionScheme
-
removeFromNode
- Specified by:
removeFromNodein interfaceServiceDisruptionScheme
-
testClusterClosed
public void testClusterClosed()- Specified by:
testClusterClosedin interfaceServiceDisruptionScheme
-
startDisrupting
public void startDisrupting()- Specified by:
startDisruptingin interfaceServiceDisruptionScheme
-
stopDisrupting
public void stopDisrupting()- Specified by:
stopDisruptingin interfaceServiceDisruptionScheme
-
expectedTimeToHeal
public org.elasticsearch.core.TimeValue expectedTimeToHeal()- Specified by:
expectedTimeToHealin interfaceServiceDisruptionScheme
-
toString
-