aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@verizonmedia.com>2020-11-03 11:01:32 +0100
committerBjørn Christian Seime <bjorncs@verizonmedia.com>2020-11-03 11:01:32 +0100
commitc56b3b30489a279223c9b06760f34da124b7e587 (patch)
treed6dab8062c08d3b25a8cd4f70ec09d2f694823c3
parent98ca8c25af21eb172f615e8a33ede9a7dab1f900 (diff)
Remove threadpool configuration for restapi handler
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/clients/ContainerDocumentApi.java5
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/xml/DocumentApiOptionsBuilder.java1
-rw-r--r--config-model/src/main/resources/schema/containercluster.rnc4
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerDocumentApiBuilderTest.java13
-rw-r--r--config-model/src/test/schema-test-files/services.xml7
5 files changed, 2 insertions, 28 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/clients/ContainerDocumentApi.java b/config-model/src/main/java/com/yahoo/vespa/model/clients/ContainerDocumentApi.java
index c6f035b2885..6ad81c90107 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/clients/ContainerDocumentApi.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/clients/ContainerDocumentApi.java
@@ -48,7 +48,7 @@ public class ContainerDocumentApi {
String bindingSuffix = "/document/v1/*";
var oldHandler = newVespaClientHandler(oldHandlerName, options.useNewRestapiHandler ? null : bindingSuffix, options);
cluster.addComponent(oldHandler);
- var executor = new Threadpool("restapi-handler", cluster, options.restApiThreadpoolOptions);
+ var executor = new Threadpool("restapi-handler", cluster, /*userOptions*/null);
oldHandler.inject(executor);
oldHandler.addComponent(executor);
@@ -83,16 +83,13 @@ public class ContainerDocumentApi {
public static final class Options {
private final Collection<String> bindings;
- private final ContainerThreadpool.UserOptions restApiThreadpoolOptions;
private final ContainerThreadpool.UserOptions feedApiThreadpoolOptions;
private final boolean useNewRestapiHandler;
public Options(Collection<String> bindings,
- ContainerThreadpool.UserOptions restApiThreadpoolOptions,
ContainerThreadpool.UserOptions feedApiThreadpoolOptions,
boolean useNewRestapiHandler) {
this.bindings = Collections.unmodifiableCollection(bindings);
- this.restApiThreadpoolOptions = restApiThreadpoolOptions;
this.feedApiThreadpoolOptions = feedApiThreadpoolOptions;
this.useNewRestapiHandler = useNewRestapiHandler;
}
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 2a64a194d37..b5f77157be1 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
@@ -23,7 +23,6 @@ public class DocumentApiOptionsBuilder {
public static ContainerDocumentApi.Options build(DeployState deployState, Element spec) {
return new ContainerDocumentApi.Options(
getBindings(spec),
- threadpoolOptions(spec, "rest-api"),
threadpoolOptions(spec, "http-client-api"),
deployState.getProperties().useNewRestapiHandler());
}
diff --git a/config-model/src/main/resources/schema/containercluster.rnc b/config-model/src/main/resources/schema/containercluster.rnc
index 98ea696ceef..66438570d2f 100644
--- a/config-model/src/main/resources/schema/containercluster.rnc
+++ b/config-model/src/main/resources/schema/containercluster.rnc
@@ -219,9 +219,7 @@ DocumentApi = element document-api {
HttpClientApi?
}
-DocumentRestApi = element rest-api {
- Threadpool?
-}
+DocumentRestApi = element rest-api { empty }
HttpClientApi = element http-client-api {
Threadpool?
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerDocumentApiBuilderTest.java b/config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerDocumentApiBuilderTest.java
index 9f061dcbd0a..3c733d5109d 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerDocumentApiBuilderTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerDocumentApiBuilderTest.java
@@ -116,13 +116,6 @@ public class ContainerDocumentApiBuilderTest extends ContainerModelBuilderTestBa
Element elem = DomBuilderTest.parse(
"<container id='cluster1' version='1.0'>",
" <document-api>",
- " <rest-api>",
- " <threadpool>",
- " <max-threads>20</max-threads>",
- " <min-threads>10</min-threads>",
- " <queue-size>0</queue-size>",
- " </threadpool>",
- " </rest-api>",
" <http-client-api>",
" <threadpool>",
" <max-threads>50</max-threads>",
@@ -135,12 +128,6 @@ public class ContainerDocumentApiBuilderTest extends ContainerModelBuilderTestBa
"</container>");
createModel(root, elem);
- ContainerThreadpoolConfig restApiThreadpoolConfig = root.getConfig(
- ContainerThreadpoolConfig.class, "cluster1/component/com.yahoo.document.restapi.resource.RestApi/threadpool@restapi-handler");
- assertEquals(20, restApiThreadpoolConfig.maxThreads());
- assertEquals(10, restApiThreadpoolConfig.minThreads());
- assertEquals(0, restApiThreadpoolConfig.queueSize());
-
ContainerThreadpoolConfig feedThreadpoolConfig = root.getConfig(
ContainerThreadpoolConfig.class, "cluster1/component/com.yahoo.vespa.http.server.FeedHandler/threadpool@feedapi-handler");
assertEquals(50, feedThreadpoolConfig.maxThreads());
diff --git a/config-model/src/test/schema-test-files/services.xml b/config-model/src/test/schema-test-files/services.xml
index 683e2dc0b0d..51310682f78 100644
--- a/config-model/src/test/schema-test-files/services.xml
+++ b/config-model/src/test/schema-test-files/services.xml
@@ -158,13 +158,6 @@
<timeout>5.55</timeout>
<route>default</route>
<maxpendingdocs>100</maxpendingdocs>
- <rest-api>
- <threadpool>
- <max-threads>50</max-threads>
- <min-threads>10</min-threads>
- <queue-size>1000</queue-size>
- </threadpool>
- </rest-api>
<http-client-api>
<threadpool>
<max-threads>50</max-threads>