diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2020-09-16 18:22:11 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2020-09-16 18:22:11 +0200 |
commit | 6d09cc239f0f4145aab0ec21419fa7726589a4d7 (patch) | |
tree | 84e7356d4cd222bc97f423773729ab69225f17e8 /config-model/src/main/java/com/yahoo/vespa/model/container/xml/DocumentApiOptionsBuilder.java | |
parent | 951e558ed5cbfa4ae98fc0962f8ebe5ea1fddeb0 (diff) |
Allow applications to override threadpool configuration in services.xml
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/container/xml/DocumentApiOptionsBuilder.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/container/xml/DocumentApiOptionsBuilder.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/DocumentApiOptionsBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/DocumentApiOptionsBuilder.java index 34de21de404..99ae6184f5c 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/DocumentApiOptionsBuilder.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/DocumentApiOptionsBuilder.java @@ -4,6 +4,7 @@ package com.yahoo.vespa.model.container.xml; import com.yahoo.config.model.deploy.DeployState; import com.yahoo.text.XML; import com.yahoo.vespa.model.clients.ContainerDocumentApi; +import com.yahoo.vespa.model.container.ContainerThreadpool; import org.w3c.dom.Element; import java.util.ArrayList; @@ -20,7 +21,17 @@ public class DocumentApiOptionsBuilder { public static ContainerDocumentApi.Options build(DeployState deployState, Element spec) { - return new ContainerDocumentApi.Options(getBindings(spec), deployState.getProperties().feedCoreThreadPoolSizeFactor()); + return new ContainerDocumentApi.Options( + getBindings(spec), + threadpoolOptions(spec, "rest-api"), + threadpoolOptions(spec, "http-client-api"), + deployState.getProperties().feedCoreThreadPoolSizeFactor()); + } + + private static ContainerThreadpool.UserOptions threadpoolOptions(Element spec, String elementName) { + Element element = XML.getChild(spec, elementName); + if (element == null) return null; + return ContainerThreadpool.UserOptions.fromXml(element).orElse(null); } private static List<String> getBindings(Element spec) { |