@Override public void execute(ClusterConfiguration config) { String clusterName = config.getClusterName(); if (clusterName == null) { throw new ElasticsearchSetupException(String.format( "Please provide a cluster name.")); } if (clusterName.matches("[a-zA-Z0-9.-]+") == false) { throw new ElasticsearchSetupException(String.format( "elasticsearch-maven-plugin supports only alphanumeric with dots and dashes cluster names. You configured: %s.", clusterName)); } }
@Override public void execute(ClusterConfiguration config) { // the instances have already started; // waiting just 10 seconds for them to form the cluster int timeout = 10; 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(), timeout); } }
"-Ecluster.name=" + config.getClusterConfiguration().getClusterName(), false); cmd.addArgument("-Ehttp.port=" + config.getHttpPort(), false);
@Override public void execute(InstanceConfiguration config) { int timeout = config.getClusterConfiguration().getTimeout(); 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); } }