org.apache.solr.cloud
Class ChaosMonkey
java.lang.Object
org.apache.solr.cloud.ChaosMonkey
public class ChaosMonkey
- extends Object
The monkey can stop random or specific jetties used with SolrCloud.
It can also run in a background thread and start and stop jetties
randomly.
TODO: expire multiple sessions / connectionloss at once
TODO: kill multiple jetties at once
TODO: ? add random headhunter mode that always kills the leader
TODO: chaosmonkey should be able to do cluster stop/start tests
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ChaosMonkey
public ChaosMonkey(ZkTestServer zkServer,
org.apache.solr.common.cloud.ZkStateReader zkStateReader,
String collection,
Map<String,List<AbstractFullDistribZkTestBase.CloudJettyRunner>> shardToJetty,
Map<String,AbstractFullDistribZkTestBase.CloudJettyRunner> shardToLeaderJetty)
expireSession
public void expireSession(org.apache.solr.client.solrj.embedded.JettySolrRunner jetty)
expireRandomSession
public void expireRandomSession()
throws org.apache.zookeeper.KeeperException,
InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
randomConnectionLoss
public void randomConnectionLoss()
throws org.apache.zookeeper.KeeperException,
InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
stopShard
public AbstractFullDistribZkTestBase.CloudJettyRunner stopShard(String slice,
int index)
throws Exception
- Throws:
Exception
stopJetty
public void stopJetty(AbstractFullDistribZkTestBase.CloudJettyRunner cjetty)
throws Exception
- Throws:
Exception
killJetty
public void killJetty(AbstractFullDistribZkTestBase.CloudJettyRunner cjetty)
throws Exception
- Throws:
Exception
stopJetty
public void stopJetty(org.apache.solr.client.solrj.embedded.JettySolrRunner jetty)
throws Exception
- Throws:
Exception
kill
public static void kill(AbstractFullDistribZkTestBase.CloudJettyRunner cjetty)
throws Exception
- Throws:
Exception
stopShard
public void stopShard(String slice)
throws Exception
- Throws:
Exception
stopShardExcept
public void stopShardExcept(String slice,
String shardName)
throws Exception
- Throws:
Exception
getShard
public org.apache.solr.client.solrj.embedded.JettySolrRunner getShard(String slice,
int index)
throws Exception
- Throws:
Exception
stopRandomShard
public AbstractFullDistribZkTestBase.CloudJettyRunner stopRandomShard()
throws Exception
- Throws:
Exception
stopRandomShard
public AbstractFullDistribZkTestBase.CloudJettyRunner stopRandomShard(String slice)
throws Exception
- Throws:
Exception
killRandomShard
public AbstractFullDistribZkTestBase.CloudJettyRunner killRandomShard()
throws Exception
- Throws:
Exception
killRandomShard
public AbstractFullDistribZkTestBase.CloudJettyRunner killRandomShard(String slice)
throws Exception
- Throws:
Exception
getRandomJetty
public AbstractFullDistribZkTestBase.CloudJettyRunner getRandomJetty(String slice,
boolean aggressivelyKillLeaders)
throws org.apache.zookeeper.KeeperException,
InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
getRandomClient
public org.apache.solr.client.solrj.SolrServer getRandomClient(String slice)
throws org.apache.zookeeper.KeeperException,
InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
startTheMonkey
public void startTheMonkey(boolean killLeaders,
int roundPauseUpperLimit)
monkeyLog
public static void monkeyLog(String msg)
stopTheMonkey
public void stopTheMonkey()
getStarts
public int getStarts()
stop
public static void stop(org.apache.solr.client.solrj.embedded.JettySolrRunner jetty)
throws Exception
- Throws:
Exception
start
public static boolean start(org.apache.solr.client.solrj.embedded.JettySolrRunner jetty)
throws Exception
- Throws:
Exception
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.