public class NetworkDisruption extends java.lang.Object implements ServiceDisruptionScheme
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 linksModifier and Type | Class and Description |
---|---|
static class |
NetworkDisruption.Bridge
Creates two partitions with symmetric failures and a bridge node that can connect to both of the partitions
|
static class |
NetworkDisruption.DisruptedLinks
Represents a set of nodes with connections between nodes that are to be disrupted
|
static class |
NetworkDisruption.IsolateAllNodes |
static class |
NetworkDisruption.NetworkDelay
Simulates slow or congested network.
|
static class |
NetworkDisruption.NetworkDisconnect
Simulates a network disconnect.
|
static class |
NetworkDisruption.NetworkLinkDisruptionType
Abstract class representing various types of network disruptions.
|
static class |
NetworkDisruption.NetworkUnresponsive
Simulates an unresponsive target node by dropping requests sent from source to target node.
|
static class |
NetworkDisruption.TwoPartitions
Creates two partitions with symmetric failures
|
Modifier and Type | Field and Description |
---|---|
protected boolean |
activeDisruption |
protected InternalTestCluster |
cluster |
Constructor and Description |
---|
NetworkDisruption(NetworkDisruption.DisruptedLinks disruptedLinks,
NetworkDisruption.NetworkLinkDisruptionType networkLinkDisruptionType) |
Modifier and Type | Method and Description |
---|---|
void |
applyToCluster(InternalTestCluster cluster) |
void |
applyToNode(java.lang.String node,
InternalTestCluster cluster) |
static void |
ensureFullyConnectedCluster(InternalTestCluster cluster)
Ensures that all nodes in the cluster are connected to each other.
|
void |
ensureHealthy(InternalTestCluster cluster)
ensures the cluster is healthy after the disruption
|
protected void |
ensureNodeCount(InternalTestCluster cluster) |
TimeValue |
expectedTimeToHeal() |
NetworkDisruption.DisruptedLinks |
getDisruptedLinks() |
NetworkDisruption.NetworkLinkDisruptionType |
getNetworkLinkDisruptionType() |
void |
removeAndEnsureHealthy(InternalTestCluster cluster) |
void |
removeFromCluster(InternalTestCluster cluster) |
void |
removeFromNode(java.lang.String node1,
InternalTestCluster cluster) |
void |
startDisrupting() |
void |
stopDisrupting() |
void |
testClusterClosed() |
java.lang.String |
toString() |
protected volatile InternalTestCluster cluster
protected volatile boolean activeDisruption
public NetworkDisruption(NetworkDisruption.DisruptedLinks disruptedLinks, NetworkDisruption.NetworkLinkDisruptionType networkLinkDisruptionType)
public NetworkDisruption.DisruptedLinks getDisruptedLinks()
public NetworkDisruption.NetworkLinkDisruptionType getNetworkLinkDisruptionType()
public void applyToCluster(InternalTestCluster cluster)
applyToCluster
in interface ServiceDisruptionScheme
public void removeFromCluster(InternalTestCluster cluster)
removeFromCluster
in interface ServiceDisruptionScheme
public void removeAndEnsureHealthy(InternalTestCluster cluster)
removeAndEnsureHealthy
in interface ServiceDisruptionScheme
public void ensureHealthy(InternalTestCluster cluster)
public static void ensureFullyConnectedCluster(InternalTestCluster cluster)
NodeConnectionsService
will eventually reconnect but it's
handy to be able to ensure this happens fasterprotected void ensureNodeCount(InternalTestCluster cluster)
public void applyToNode(java.lang.String node, InternalTestCluster cluster)
applyToNode
in interface ServiceDisruptionScheme
public void removeFromNode(java.lang.String node1, InternalTestCluster cluster)
removeFromNode
in interface ServiceDisruptionScheme
public void testClusterClosed()
testClusterClosed
in interface ServiceDisruptionScheme
public void startDisrupting()
startDisrupting
in interface ServiceDisruptionScheme
public void stopDisrupting()
stopDisrupting
in interface ServiceDisruptionScheme
public TimeValue expectedTimeToHeal()
expectedTimeToHeal
in interface ServiceDisruptionScheme
public java.lang.String toString()
toString
in class java.lang.Object