import org.elasticsearch.action.search.SearchScrollRequestBuilder;
import org.elasticsearch.action.update.UpdateRequest;
import org.elasticsearch.client.Client;
-import org.elasticsearch.common.settings.ImmutableSettings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.XContentBuilder;
private void initializeManagementIndex() {
LOG.debug("Setup of Management Index for ES");
- String index = indexDefinition.getManagementIndex();
-
- IndicesExistsResponse indexExistsResponse = getClient().admin().indices()
- .prepareExists(index).execute().actionGet();
-
- if (!indexExistsResponse.isExists()) {
- getClient().admin().indices().prepareCreate(index)
- .setSettings(ImmutableSettings.builder()
- .put("mapper.dynamic", true)
- .put("number_of_replicas", 1)
- .put("number_of_shards", 1)
- .build())
- .get();
- }
+// String index = indexDefinition.getManagementIndex();
+//
+// IndicesExistsResponse indexExistsResponse = getClient().admin().indices()
+// .prepareExists(index).execute().actionGet();
+//
+// if (!indexExistsResponse.isExists()) {
+// getClient().admin().indices().prepareCreate(index)
+// .setSettings(ImmutableSettings.builder()
+// .put("mapper.dynamic", true)
+// .put("number_of_replicas", 1)
+// .put("number_of_shards", 1)
+// .build())
+// .get();
+// }
}
protected void initializeIndex() {
.admin()
.indices()
.prepareRefresh(this.getIndexName())
+ .setForce(false)
+ .setIndices(this.getIndexName())
.get();
}
IndexProperties.ES_TYPE.DATA;
ImmutableSettings.Builder esSettings = ImmutableSettings.settingsBuilder()
+ .put("index.merge.policy.max_merge_at_once", "200")
+ .put("index.merge.policy.segments_per_tier", "200")
+
+ .put("indices.store.throttle.type", "merge")
+ .put("indices.store.throttle.max_bytes_per_sec", "200mb")
+
.put("script.default_lang", "native")
.put("script.native." + ListUpdate.NAME + ".type", UpdateListScriptFactory.class.getName());
.put("node.name", "sonarqube-" + System.currentTimeMillis())
.put("node.data", true)
.put("node.local", true)
+ .put("index.store.type", "mmapfs")
.put("cluster.name", "sonarqube")
.put("index.number_of_shards", "1")
.put("index.number_of_replicas", "0");