From 99f8c6a3ba17602df4ad66052fc70ca3a6897285 Mon Sep 17 00:00:00 2001 From: Stephane Gamard Date: Tue, 23 Sep 2014 11:50:07 +0200 Subject: SONAR-5531 - Optimized Issue index for mass indexing --- .../sonar-search/src/main/java/org/sonar/search/SearchServer.java | 6 +++++- .../src/main/java/org/sonar/server/issue/index/IssueIndex.java | 2 ++ .../src/main/java/org/sonar/server/search/BaseIndex.java | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'server') diff --git a/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java b/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java index 1c2ffdc57e7..f74d51fce42 100644 --- a/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java +++ b/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java @@ -88,7 +88,7 @@ public class SearchServer implements Monitored { .put("discovery.zen.ping.multicast.enabled", "false") // Index storage policies - .put("index.refresh_interval", "30") + .put("index.refresh_interval", "30s") .put("index.number_of_shards", "1") .put("index.number_of_replicas", MINIMUM_INDEX_REPLICATION) .put("index.store.type", "mmapfs") @@ -96,6 +96,10 @@ public class SearchServer implements Monitored { .put("index.merge.scheduler.max_thread_count", Math.max(1, Math.min(3, Runtime.getRuntime().availableProcessors() / 2))) + // Optimization TBD (second one must have ES > 1.2 + // .put("indices.memory.index_buffer_size", "512mb") + // .put("index.translog.flush_threshold_size", "1gb") + // Install our own listUpdate scripts .put("script.default_lang", "native") .put("script.native." + ListUpdate.NAME + ".type", ListUpdate.UpdateListScriptFactory.class.getName()) diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java index 7825074a811..152f6440213 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java @@ -20,6 +20,7 @@ package org.sonar.server.issue.index; import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; import org.apache.commons.lang.BooleanUtils; import org.elasticsearch.action.search.SearchRequestBuilder; import org.elasticsearch.action.search.SearchResponse; @@ -77,6 +78,7 @@ public class IssueIndex extends BaseIndex { protected Map mapDomain() { Map mapping = new HashMap(); mapping.put("dynamic", false); + mapping.put("_all", ImmutableMap.of("enabled", false)); mapping.put("_id", mapKey()); mapping.put("_parent", mapParent()); mapping.put("_routing", mapRouting()); diff --git a/server/sonar-server/src/main/java/org/sonar/server/search/BaseIndex.java b/server/sonar-server/src/main/java/org/sonar/server/search/BaseIndex.java index 65c73da1ffa..fe5df3dffbb 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/search/BaseIndex.java +++ b/server/sonar-server/src/main/java/org/sonar/server/search/BaseIndex.java @@ -227,6 +227,7 @@ public abstract class BaseIndex, KEY extends Serial protected Map mapDomain() { Map mapping = new HashMap(); mapping.put("dynamic", false); + mapping.put("_all", ImmutableMap.of("enabled", false)); if (mapKey() != null) { mapping.put("_id", mapKey()); } -- cgit v1.2.3