Merge "Always use a thread pool for interactive indexing"
This commit is contained in:
@@ -2400,10 +2400,10 @@ By default, `LUCENE`.
|
|||||||
|
|
||||||
[[index.threads]]index.threads::
|
[[index.threads]]index.threads::
|
||||||
+
|
+
|
||||||
Number of threads to use for indexing in normal interactive operations. If set
|
Number of threads to use for indexing in normal interactive operations.
|
||||||
to 0, indexing will be done in the same thread as the interactive operation.
|
|
||||||
+
|
+
|
||||||
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::
|
[[index.batchThreads]]index.batchThreads::
|
||||||
+
|
+
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ public class IndexModule extends LifecycleModule {
|
|||||||
threads = config.getInt("index", null, "threads", 0);
|
threads = config.getInt("index", null, "threads", 0);
|
||||||
}
|
}
|
||||||
if (threads <= 0) {
|
if (threads <= 0) {
|
||||||
return MoreExecutors.newDirectExecutorService();
|
threads = Runtime.getRuntime().availableProcessors() / 2 + 1;
|
||||||
}
|
}
|
||||||
return MoreExecutors.listeningDecorator(
|
return MoreExecutors.listeningDecorator(
|
||||||
workQueue.createQueue(threads, "Index-Interactive"));
|
workQueue.createQueue(threads, "Index-Interactive"));
|
||||||
|
|||||||
Reference in New Issue
Block a user