public class ChaosMonkey extends Object
| Constructor and Description |
|---|
ChaosMonkey(ZkTestServer zkServer,
org.apache.solr.common.cloud.ZkStateReader zkStateReader,
String collection,
Map<String,List<AbstractFullDistribZkTestBase.CloudJettyRunner>> shardToJetty,
Map<String,AbstractFullDistribZkTestBase.CloudJettyRunner> shardToLeaderJetty) |
| Modifier and Type | Method and Description |
|---|---|
static void |
causeConnectionLoss(org.apache.solr.client.solrj.embedded.JettySolrRunner jetty) |
void |
causeSomeChaos()
causes some randomly selected chaos
|
void |
expireRandomSession() |
void |
expireSession(org.apache.solr.client.solrj.embedded.JettySolrRunner jetty) |
AbstractFullDistribZkTestBase.CloudJettyRunner |
getRandomJetty(String slice,
boolean aggressivelyKillLeaders) |
org.apache.solr.client.solrj.embedded.JettySolrRunner |
getShard(String slice,
int index) |
int |
getStarts() |
AbstractFullDistribZkTestBase.CloudJettyRunner |
killRandomShard() |
AbstractFullDistribZkTestBase.CloudJettyRunner |
killRandomShard(String slice) |
static void |
monkeyLog(String msg) |
static void |
monkeyLog(String msg,
Object... logParams) |
void |
randomConnectionLoss() |
static void |
start(List<org.apache.solr.client.solrj.embedded.JettySolrRunner> jettys) |
void |
startAll() |
void |
startTheMonkey(boolean killLeaders,
int roundPauseUpperLimit) |
static void |
stop(List<org.apache.solr.client.solrj.embedded.JettySolrRunner> jettys) |
void |
stopAll(int pauseBetweenMs) |
void |
stopJetty(AbstractFullDistribZkTestBase.CloudJettyRunner cjetty) |
AbstractFullDistribZkTestBase.CloudJettyRunner |
stopRandomShard() |
AbstractFullDistribZkTestBase.CloudJettyRunner |
stopRandomShard(String slice) |
void |
stopShard(String slice) |
AbstractFullDistribZkTestBase.CloudJettyRunner |
stopShard(String slice,
int index) |
void |
stopShardExcept(String slice,
String shardName) |
void |
stopTheMonkey() |
static void |
wait(long runLength,
String collectionName,
org.apache.solr.common.cloud.ZkStateReader zkStateReader)
You can call this method to wait while the ChaosMonkey is running, it waits approximately the specified time, and periodically
logs the status of the collection
|
public ChaosMonkey(ZkTestServer zkServer, org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collection, Map<String,List<AbstractFullDistribZkTestBase.CloudJettyRunner>> shardToJetty, Map<String,AbstractFullDistribZkTestBase.CloudJettyRunner> shardToLeaderJetty)
public void expireSession(org.apache.solr.client.solrj.embedded.JettySolrRunner jetty)
public void expireRandomSession()
throws org.apache.zookeeper.KeeperException,
InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic void randomConnectionLoss()
throws org.apache.zookeeper.KeeperException,
InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic static void causeConnectionLoss(org.apache.solr.client.solrj.embedded.JettySolrRunner jetty)
public AbstractFullDistribZkTestBase.CloudJettyRunner stopShard(String slice, int index) throws Exception
Exceptionpublic void stopJetty(AbstractFullDistribZkTestBase.CloudJettyRunner cjetty) throws Exception
Exceptionpublic void stopShardExcept(String slice, String shardName) throws Exception
Exceptionpublic org.apache.solr.client.solrj.embedded.JettySolrRunner getShard(String slice, int index) throws Exception
Exceptionpublic AbstractFullDistribZkTestBase.CloudJettyRunner stopRandomShard() throws Exception
Exceptionpublic AbstractFullDistribZkTestBase.CloudJettyRunner stopRandomShard(String slice) throws Exception
Exceptionpublic AbstractFullDistribZkTestBase.CloudJettyRunner killRandomShard() throws Exception
Exceptionpublic AbstractFullDistribZkTestBase.CloudJettyRunner killRandomShard(String slice) throws Exception
Exceptionpublic AbstractFullDistribZkTestBase.CloudJettyRunner getRandomJetty(String slice, boolean aggressivelyKillLeaders) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic void startTheMonkey(boolean killLeaders,
int roundPauseUpperLimit)
public static void monkeyLog(String msg)
public void stopTheMonkey()
public void causeSomeChaos()
throws Exception
Exceptionpublic int getStarts()
public static void stop(List<org.apache.solr.client.solrj.embedded.JettySolrRunner> jettys) throws Exception
Exceptionpublic static void start(List<org.apache.solr.client.solrj.embedded.JettySolrRunner> jettys) throws Exception
Exceptionpublic static void wait(long runLength,
String collectionName,
org.apache.solr.common.cloud.ZkStateReader zkStateReader)
throws InterruptedException
runLength - The time in ms to waitcollectionName - The main collection being used for the ChaosMonkeyzkStateReader - current state readerInterruptedExceptionCopyright © 2000-2019 Apache Software Foundation. All Rights Reserved.