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.
|
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.
|
TransportAddress |
externalTransportAddress() |
void |
fullRestartInternalCluster()
Delegates to
InternalTestCluster.fullRestart() |
java.lang.Iterable<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(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(Settings nodeSettings)
Upgrades one external running node to a node from the version running the tests.
|
assertAfterTest, beforeIndexDeletion, seed, wipe, wipeAllTemplates, wipeIndices, wipeRepositories, wipeTemplates
public CompositeTestCluster(InternalTestCluster cluster, int numExternalNodes, org.elasticsearch.test.ExternalNode externalNode) throws java.io.IOException
java.io.IOException
public void afterTest() throws java.io.IOException
TestCluster
afterTest
in class TestCluster
java.io.IOException
public void beforeTest(java.util.Random random, double transportClientRatio) throws java.io.IOException, java.lang.InterruptedException
TestCluster
beforeTest
in class TestCluster
java.io.IOException
java.lang.InterruptedException
public boolean upgradeOneNode() throws java.lang.InterruptedException, java.io.IOException
java.lang.InterruptedException
java.io.IOException
public boolean upgradeAllNodes() throws java.lang.InterruptedException, java.io.IOException
true
iff at least one node as upgraded.java.lang.InterruptedException
java.io.IOException
public boolean upgradeAllNodes(Settings nodeSettings) throws java.lang.InterruptedException, java.io.IOException
nodeSettings
- settings for the upgrade nodestrue
iff at least one node as upgraded.java.lang.InterruptedException
java.io.IOException
public boolean upgradeOneNode(Settings nodeSettings) throws java.lang.InterruptedException, java.io.IOException
java.lang.InterruptedException
java.io.IOException
public 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 Client client()
TestCluster
client
in class TestCluster
public int size()
TestCluster
size
in class TestCluster
public int numDataNodes()
TestCluster
numDataNodes
in class TestCluster
public int numDataAndMasterNodes()
TestCluster
numDataAndMasterNodes
in class TestCluster
public java.net.InetSocketAddress[] httpAddresses()
TestCluster
httpAddresses
in class TestCluster
public void close() throws java.io.IOException
TestCluster
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class TestCluster
java.io.IOException
public void ensureEstimatedStats()
TestCluster
ensureEstimatedStats
in class TestCluster
public java.lang.String getClusterName()
TestCluster
getClusterName
in class TestCluster
public java.lang.Iterable<Client> getClients()
TestCluster
Iterable
over all clients in this test clustergetClients
in class TestCluster
public void fullRestartInternalCluster() throws java.lang.Exception
InternalTestCluster.fullRestart()
java.lang.Exception
public int numNewDataNodes()
public int numBackwardsDataNodes()
public TransportAddress externalTransportAddress()
public InternalTestCluster internalCluster()