5882: put back Elasticsearch's 1.1 defaults for ConcurrentMergeScheduler

This commit is contained in:
mikemccand 2014-05-12 13:22:33 -04:00
parent 4b2e4becc7
commit eae304aa39
1 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,6 @@
package org.elasticsearch.index.merge.scheduler;
import com.google.common.collect.ImmutableSet;
import org.apache.lucene.index.ConcurrentMergeScheduler;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.MergePolicy;
import org.apache.lucene.index.MergeScheduler;
@ -57,8 +56,9 @@ public class ConcurrentMergeSchedulerProvider extends MergeSchedulerProvider {
public ConcurrentMergeSchedulerProvider(ShardId shardId, @IndexSettings Settings indexSettings, ThreadPool threadPool, IndexSettingsService indexSettingsService) {
super(shardId, indexSettings, threadPool);
this.indexSettingsService = indexSettingsService;
this.maxThreadCount = componentSettings.getAsInt("max_thread_count", ConcurrentMergeScheduler.DEFAULT_MAX_THREAD_COUNT);
this.maxMergeCount = componentSettings.getAsInt("max_merge_count", ConcurrentMergeScheduler.DEFAULT_MAX_MERGE_COUNT);
// TODO LUCENE MONITOR this will change in Lucene 4.0
this.maxThreadCount = componentSettings.getAsInt("max_thread_count", Math.max(1, Math.min(3, Runtime.getRuntime().availableProcessors() / 2)));
this.maxMergeCount = componentSettings.getAsInt("max_merge_count", maxThreadCount + 2);
logger.debug("using [concurrent] merge scheduler with max_thread_count[{}], max_merge_count[{}]", maxThreadCount, maxMergeCount);
indexSettingsService.addListener(applySettings);