log.info("Starting Elasticsearch");
String mode = env.getRequiredProperty("elasticsearch.engine.mode");
if (REMOTE_ENGINE.equalsIgnoreCase(mode)) {
return new RemoteElasticsearchEngine();
} else if (EMBEDDED_ENGINE.equalsIgnoreCase(mode)) {
return new EmbeddedElasticsearchEngine();
} else {
//Log do not support log.fatal
log.error("Elasticsearch engine mode is not defined, please configure the \"elasticsearch.engine.mode\" property");
throw new IllegalArgumentException("Elasticsearch engine mode " + mode + " not defined");
}