public class CompositeTestCluster extends TestCluster
logger, random, transportClientRatio| Constructor and Description |
|---|
CompositeTestCluster(InternalTestCluster cluster,
int numExternalNodes,
org.elasticsearch.test.ExternalNode externalNode) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterTest()
This method should be executed during tear down, after each test (but after assertAfterTest)
|
void |
allowOnAllNodes(java.lang.String... index)
Allows allocation of shards of the given indices on all nodes in the cluster.
|
void |
allowOnlyNewNodes(java.lang.String... index)
Allows allocation of shards of the given indices only on "new" nodes in the cluster.
|
java.lang.String |
backwardsNodePattern()
Returns the a simple pattern that matches all "old" / "backwardss" nodes in the cluster.
|
void |
beforeTest(java.util.Random random,
double transportClientRatio)
This method should be executed before each test to reset the cluster to its initial state.
|
org.elasticsearch.client.Client |
client()
Returns a client connected to any node in the cluster
|
void |
close()
Closes the current cluster
|
void |
ensureEstimatedStats()
Ensures that any breaker statistics are reset to 0.
|
org.elasticsearch.common.transport.TransportAddress |
externalTransportAddress() |
void |
fullRestartInternalCluster()
Delegates to
InternalTestCluster.fullRestart() |
java.lang.Iterable<org.elasticsearch.client.Client> |
getClients()
Returns an
Iterable over all clients in this test cluster |
java.lang.String |
getClusterName()
Returns the cluster name
|
java.net.InetSocketAddress[] |
httpAddresses()
Returns the http addresses of the nodes within the cluster.
|
InternalTestCluster |
internalCluster() |
java.lang.String |
newNodePattern()
Returns the a simple pattern that matches all "new" nodes in the cluster.
|
int |
numBackwardsDataNodes()
Returns the number of former version data nodes in the cluster
|
int |
numDataAndMasterNodes()
Returns the number of data and master eligible nodes in the cluster.
|
int |
numDataNodes()
Returns the number of data nodes in the cluster.
|
int |
numNewDataNodes()
Returns the number of current version data nodes in the cluster
|
int |
size()
Returns the number of nodes in the cluster.
|
void |
startNewNode()
Starts a current version data node
|
boolean |
upgradeAllNodes()
Upgrades all external running nodes to a node from the version running the tests.
|
boolean |
upgradeAllNodes(org.elasticsearch.common.settings.Settings nodeSettings)
Upgrades all external running nodes to a node from the version running the tests.
|
boolean |
upgradeOneNode()
Upgrades one external running node to a node from the version running the tests.
|
boolean |
upgradeOneNode(org.elasticsearch.common.settings.Settings nodeSettings)
Upgrades one external running node to a node from the version running the tests.
|
assertAfterTest, beforeIndexDeletion, seed, wipe, wipeAllTemplates, wipeIndices, wipeRepositories, wipeTemplatespublic CompositeTestCluster(InternalTestCluster cluster, int numExternalNodes, org.elasticsearch.test.ExternalNode externalNode) throws java.io.IOException
java.io.IOExceptionpublic void afterTest()
throws java.io.IOException
TestClusterafterTest in class TestClusterjava.io.IOExceptionpublic void beforeTest(java.util.Random random,
double transportClientRatio)
throws java.io.IOException,
java.lang.InterruptedException
TestClusterbeforeTest in class TestClusterjava.io.IOExceptionjava.lang.InterruptedExceptionpublic boolean upgradeOneNode()
throws java.lang.InterruptedException,
java.io.IOException
java.lang.InterruptedExceptionjava.io.IOExceptionpublic boolean upgradeAllNodes()
throws java.lang.InterruptedException,
java.io.IOException
true iff at least one node as upgraded.java.lang.InterruptedExceptionjava.io.IOExceptionpublic boolean upgradeAllNodes(org.elasticsearch.common.settings.Settings nodeSettings)
throws java.lang.InterruptedException,
java.io.IOException
nodeSettings - settings for the upgrade nodestrue iff at least one node as upgraded.java.lang.InterruptedExceptionjava.io.IOExceptionpublic boolean upgradeOneNode(org.elasticsearch.common.settings.Settings nodeSettings)
throws java.lang.InterruptedException,
java.io.IOException
java.lang.InterruptedExceptionjava.io.IOExceptionpublic java.lang.String newNodePattern()
public java.lang.String backwardsNodePattern()
public void allowOnAllNodes(java.lang.String... index)
public void allowOnlyNewNodes(java.lang.String... index)
public void startNewNode()
public org.elasticsearch.client.Client client()
TestClusterclient in class TestClusterpublic int size()
TestClustersize in class TestClusterpublic int numDataNodes()
TestClusternumDataNodes in class TestClusterpublic int numDataAndMasterNodes()
TestClusternumDataAndMasterNodes in class TestClusterpublic java.net.InetSocketAddress[] httpAddresses()
TestClusterhttpAddresses in class TestClusterpublic void close()
throws java.io.IOException
TestClusterclose in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class TestClusterjava.io.IOExceptionpublic void ensureEstimatedStats()
TestClusterensureEstimatedStats in class TestClusterpublic java.lang.String getClusterName()
TestClustergetClusterName in class TestClusterpublic java.lang.Iterable<org.elasticsearch.client.Client> getClients()
TestClusterIterable over all clients in this test clustergetClients in class TestClusterpublic void fullRestartInternalCluster()
throws java.lang.Exception
InternalTestCluster.fullRestart()java.lang.Exceptionpublic int numNewDataNodes()
public int numBackwardsDataNodes()
public org.elasticsearch.common.transport.TransportAddress externalTransportAddress()
public InternalTestCluster internalCluster()