]> source.dussan.org Git - sonarqube.git/commitdiff
Disable automatic refresh of ES index "sourcelines"
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 20 Feb 2015 14:32:37 +0000 (15:32 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 20 Feb 2015 14:33:50 +0000 (15:33 +0100)
Index is manually refreshed by BulkIndexer

server/sonar-server/src/main/java/org/sonar/server/es/BulkIndexer.java
server/sonar-server/src/main/java/org/sonar/server/source/index/SourceLineIndexDefinition.java

index 4925a050ba0d4c619f6687b7e2aa4a5975a5a71b..28384f0f074ae6e5b426346642d74001524730eb 100644 (file)
@@ -50,7 +50,7 @@ import java.util.concurrent.atomic.AtomicLong;
  */
 public class BulkIndexer implements Startable {
   private static final Logger LOGGER = Loggers.get(BulkIndexer.class);
-  private static final long FLUSH_BYTE_SIZE = new ByteSizeValue(5, ByteSizeUnit.MB).bytes();
+  private static final long FLUSH_BYTE_SIZE = new ByteSizeValue(2, ByteSizeUnit.MB).bytes();
   private static final String REFRESH_INTERVAL_SETTING = "index.refresh_interval";
   private static final String ALREADY_STARTED_MESSAGE = "Bulk indexing is already started";
 
index 8b3f32cbdc56392df6f91e36ceef1762d07b2a5e..70aa212006d58f8042bdfb9e21ab546ec9831f46 100644 (file)
@@ -63,6 +63,9 @@ public class SourceLineIndexDefinition implements IndexDefinition {
   public void define(IndexDefinitionContext context) {
     NewIndex index = context.create(INDEX);
 
+    // refresh is always handled by SourceLineIndexer
+    index.getSettings().put("index.refresh_interval", "-1");
+
     // shards
     boolean clusterMode = settings.getBoolean(ProcessConstants.CLUSTER_ACTIVATE);
     if (clusterMode) {