Merge "Always use a thread pool for interactive indexing"

This commit is contained in:
David Pursehouse
2016-05-10 04:47:15 +00:00
committed by Gerrit Code Review
2 changed files with 4 additions and 4 deletions

View File

@@ -2400,10 +2400,10 @@ By default, `LUCENE`.
[[index.threads]]index.threads::
+
Number of threads to use for indexing in normal interactive operations. If set
to 0, indexing will be done in the same thread as the interactive operation.
Number of threads to use for indexing in normal interactive operations.
+
Defaults to 0 if not set, or set to a negative value.
If not set or set to a negative value, defaults to 1 plus half of the number of
logical CPUs as returned by the JVM.
[[index.batchThreads]]index.batchThreads::
+

View File

@@ -140,7 +140,7 @@ public class IndexModule extends LifecycleModule {
threads = config.getInt("index", null, "threads", 0);
}
if (threads <= 0) {
return MoreExecutors.newDirectExecutorService();
threads = Runtime.getRuntime().availableProcessors() / 2 + 1;
}
return MoreExecutors.listeningDecorator(
workQueue.createQueue(threads, "Index-Interactive"));