Search in sources :

Example 1 with Monitor

use of com.github.alexcojocaru.mojo.elasticsearch.v2.client.Monitor in project elasticsearch-maven-plugin by alexcojocaru.

the class WaitToStartInstanceStep method execute.

@Override
public void execute(InstanceConfiguration config) {
    int timeout = config.getStartupTimeout();
    try (ElasticsearchClient client = new ElasticsearchClient.Builder().withInstanceConfiguration(config).withHostname("localhost").build()) {
        Monitor monitor = new Monitor(client, config.getClusterConfiguration().getLog());
        monitor.waitToStartInstance(config.getBaseDir(), config.getClusterConfiguration().getClusterName(), timeout);
    }
}
Also used : Monitor(com.github.alexcojocaru.mojo.elasticsearch.v2.client.Monitor) ElasticsearchClient(com.github.alexcojocaru.mojo.elasticsearch.v2.client.ElasticsearchClient)

Example 2 with Monitor

use of com.github.alexcojocaru.mojo.elasticsearch.v2.client.Monitor in project elasticsearch-maven-plugin by alexcojocaru.

the class WaitToStartClusterStep method execute.

@Override
public void execute(ClusterConfiguration config) {
    try (ElasticsearchClient client = new ElasticsearchClient.Builder().withInstanceConfiguration(config.getInstanceConfigurationList().get(0)).withHostname("localhost").build()) {
        Monitor monitor = new Monitor(client, config.getLog());
        monitor.waitToStartCluster(config.getClusterName(), config.getInstanceConfigurationList().size(), config.getStartupTimeout());
    }
}
Also used : Monitor(com.github.alexcojocaru.mojo.elasticsearch.v2.client.Monitor) ElasticsearchClient(com.github.alexcojocaru.mojo.elasticsearch.v2.client.ElasticsearchClient)

Aggregations

ElasticsearchClient (com.github.alexcojocaru.mojo.elasticsearch.v2.client.ElasticsearchClient)2 Monitor (com.github.alexcojocaru.mojo.elasticsearch.v2.client.Monitor)2