ServiceDisruptionSchemepublic 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 links| Modifier and Type | Class | 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 | Description |
|---|---|---|
protected boolean |
activeDisruption |
|
protected InternalTestCluster |
cluster |
| Constructor | Description |
|---|---|
NetworkDisruption(NetworkDisruption.DisruptedLinks disruptedLinks,
NetworkDisruption.NetworkLinkDisruptionType networkLinkDisruptionType) |
| Modifier and Type | Method | 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 ServiceDisruptionSchemepublic void removeFromCluster(InternalTestCluster cluster)
removeFromCluster in interface ServiceDisruptionSchemepublic void removeAndEnsureHealthy(InternalTestCluster cluster)
removeAndEnsureHealthy in interface ServiceDisruptionSchemepublic 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 ServiceDisruptionSchemepublic void removeFromNode(java.lang.String node1,
InternalTestCluster cluster)
removeFromNode in interface ServiceDisruptionSchemepublic void testClusterClosed()
testClusterClosed in interface ServiceDisruptionSchemepublic void startDisrupting()
startDisrupting in interface ServiceDisruptionSchemepublic void stopDisrupting()
stopDisrupting in interface ServiceDisruptionSchemepublic TimeValue expectedTimeToHeal()
expectedTimeToHeal in interface ServiceDisruptionSchemepublic java.lang.String toString()
toString in class java.lang.Object