System.out.println(String.format("Launched a %d %s Elasticsearch-YARN cluster [%s@%s] at %tc",
cfg.containersToAllocate(), (cfg.containersToAllocate() > 1 ? "nodes" : "node"), id, report.getTrackingUrl(), report.getStartTime()));
}
private void stop() {
ClientRpc client = new ClientRpc(getConf());
client.start();
try {
List<ApplicationReport> esApps = client.listEsClustersAlive();
for (ApplicationReport report : esApps) {
System.out.println(String.format("Stopping Elasticsearch-YARN Cluster with id %s", report.getApplicationId()));
}
List<ApplicationReport> apps = client.killEsApps();
for (ApplicationReport report : apps) {
System.out.println(String.format("Stopped Elasticsearch-YARN cluster with id %s", report.getApplicationId()));
}
} finally {
client.close();
}
}