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.KeeperException
InterruptedException
public void randomConnectionLoss() throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public static void causeConnectionLoss(org.apache.solr.client.solrj.embedded.JettySolrRunner jetty)
public AbstractFullDistribZkTestBase.CloudJettyRunner stopShard(String slice, int index) throws Exception
Exception
public void stopJetty(AbstractFullDistribZkTestBase.CloudJettyRunner cjetty) throws Exception
Exception
public void stopShardExcept(String slice, String shardName) throws Exception
Exception
public org.apache.solr.client.solrj.embedded.JettySolrRunner getShard(String slice, int index) throws Exception
Exception
public AbstractFullDistribZkTestBase.CloudJettyRunner stopRandomShard() throws Exception
Exception
public AbstractFullDistribZkTestBase.CloudJettyRunner stopRandomShard(String slice) throws Exception
Exception
public AbstractFullDistribZkTestBase.CloudJettyRunner killRandomShard() throws Exception
Exception
public AbstractFullDistribZkTestBase.CloudJettyRunner killRandomShard(String slice) throws Exception
Exception
public AbstractFullDistribZkTestBase.CloudJettyRunner getRandomJetty(String slice, boolean aggressivelyKillLeaders) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public void startTheMonkey(boolean killLeaders, int roundPauseUpperLimit)
public static void monkeyLog(String msg)
public void stopTheMonkey()
public void causeSomeChaos() throws Exception
Exception
public int getStarts()
public static void stop(List<org.apache.solr.client.solrj.embedded.JettySolrRunner> jettys) throws Exception
Exception
public static void start(List<org.apache.solr.client.solrj.embedded.JettySolrRunner> jettys) throws Exception
Exception
public 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 readerInterruptedException
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.