diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2021-10-21 18:02:22 +0200 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2021-10-21 18:02:22 +0200 |
commit | 8108b988add04d9f63c26f86b950796d60397e0e (patch) | |
tree | b12caeb3afe9a18cddaeb3671103fc77c0e150cb /config-model | |
parent | 9e2cbe370e498fe0a89c8abae2a8b23344cf3f6a (diff) |
Inject feed-handler thread pool to /doc/v1
Diffstat (limited to 'config-model')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/clients/ContainerDocumentApi.java | 13 |
1 files changed, 7 insertions, 6 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 8534e1f65a7..0177aa6b2e8 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 @@ -23,23 +23,24 @@ public class ContainerDocumentApi { public static final String DOCUMENT_V1_PREFIX = "/document/v1"; public ContainerDocumentApi(ContainerCluster<?> cluster, Options options) { - addRestApiHandler(cluster, options); - addFeedHandler(cluster, options); + var executor = new Threadpool("feedapi-handler", cluster, options.feedApiThreadpoolOptions); + cluster.addComponent(executor); + addRestApiHandler(cluster, options, executor); + addFeedHandler(cluster, options, executor); } - private static void addFeedHandler(ContainerCluster<?> cluster, Options options) { + private static void addFeedHandler(ContainerCluster<?> cluster, Options options, Threadpool executor) { String bindingSuffix = ContainerCluster.RESERVED_URI_PREFIX + "/feedapi"; var handler = newVespaClientHandler("com.yahoo.vespa.http.server.FeedHandler", bindingSuffix, options); cluster.addComponent(handler); - var executor = new Threadpool("feedapi-handler", cluster, options.feedApiThreadpoolOptions); handler.inject(executor); - handler.addComponent(executor); } - private static void addRestApiHandler(ContainerCluster<?> cluster, Options options) { + private static void addRestApiHandler(ContainerCluster<?> cluster, Options options, Threadpool executor) { var handler = newVespaClientHandler("com.yahoo.document.restapi.resource.DocumentV1ApiHandler", DOCUMENT_V1_PREFIX + "/*", options); cluster.addComponent(handler); + handler.inject(executor); // We need to include a dummy implementation of the previous restapi handler (using the same class name). // The internal legacy test framework requires that the name of the old handler is listed in /ApplicationStatus. |