import org.apache.commons.dbutils.DbUtils;
import org.elasticsearch.index.query.QueryBuilders;
+import org.slf4j.LoggerFactory;
import org.sonar.api.ServerComponent;
import org.sonar.core.persistence.DatabaseVersion;
import org.sonar.core.persistence.DbSession;
}
public void clearIndexes() {
+ LoggerFactory.getLogger(getClass()).info("Truncate Elasticsearch indices");
searchClient.prepareDeleteByQuery(searchClient.prepareState().get()
.getState().getMetaData().concreteAllIndices())
.setQuery(QueryBuilders.matchAllQuery())
}
try {
+ LOG.info("Starting elasticsearch server");
searchServer.start();
// wait for ES to be ready
searchServer.isReady();
+ LOG.info("Elasticsearch server started");
platform.init(properties);
platform.addComponents(components);
platform = null;
try {
if (searchServer != null) {
+ LOG.info("Stopping Elasticsearch server");
searchServer.stop();
+ LOG.info("Elasticsearch server stopped");
}
} catch (Exception e) {
LOG.error("Fail to stop elasticsearch server", e);