summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/clients/ContainerDocumentApi.java21
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainerCluster.java2
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/xml/DocumentApiOptionsBuilder.java3
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/builder/xml/dom/ContentBuilderTest.java1
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/content/IndexedTest.java2
5 files changed, 18 insertions, 11 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 feaa6eb5940..9018a0231db 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
@@ -41,13 +41,17 @@ public class ContainerDocumentApi {
private static void addRestApiHandler(ContainerCluster<?> cluster, Options options) {
- var handler = newVespaClientHandler(
- "com.yahoo.document.restapi.resource.RestApi", "/document/v1/*", options);
+ String handlerClassName = options.useNewRestapiHandler
+ ? "com.yahoo.document.restapi.resource.DocumentV1ApiHandler"
+ : "com.yahoo.document.restapi.resource.RestApi";
+ var handler = newVespaClientHandler(handlerClassName, "/document/v1/*", options);
cluster.addComponent(handler);
- var executor = new Threadpool(
- "restapi-handler", cluster, options.restApiThreadpoolOptions, options.feedThreadPoolSizeFactor);
- handler.inject(executor);
- handler.addComponent(executor);
+ if (!options.useNewRestapiHandler) {
+ var executor = new Threadpool(
+ "restapi-handler", cluster, options.restApiThreadpoolOptions, options.feedThreadPoolSizeFactor);
+ handler.inject(executor);
+ handler.addComponent(executor);
+ }
}
private static Handler<AbstractConfigProducer<?>> newVespaClientHandler(
@@ -76,15 +80,18 @@ public class ContainerDocumentApi {
private final ContainerThreadpool.UserOptions restApiThreadpoolOptions;
private final ContainerThreadpool.UserOptions feedApiThreadpoolOptions;
private final double feedThreadPoolSizeFactor;
+ private final boolean useNewRestapiHandler;
public Options(Collection<String> bindings,
ContainerThreadpool.UserOptions restApiThreadpoolOptions,
ContainerThreadpool.UserOptions feedApiThreadpoolOptions,
- double feedThreadPoolSizeFactor) {
+ double feedThreadPoolSizeFactor,
+ boolean useNewRestapiHandler) {
this.bindings = Collections.unmodifiableCollection(bindings);
this.restApiThreadpoolOptions = restApiThreadpoolOptions;
this.feedApiThreadpoolOptions = feedApiThreadpoolOptions;
this.feedThreadPoolSizeFactor = feedThreadPoolSizeFactor;
+ this.useNewRestapiHandler = useNewRestapiHandler;
}
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainerCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainerCluster.java
index 2f33684c64e..7822b03db08 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainerCluster.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainerCluster.java
@@ -94,7 +94,7 @@ public final class ApplicationContainerCluster extends ContainerCluster<Applicat
addSimpleComponent("com.yahoo.container.jdisc.CertificateStoreProvider");
addSimpleComponent("com.yahoo.container.jdisc.AthenzIdentityProviderProvider");
addSimpleComponent("com.yahoo.container.jdisc.SystemInfoProvider");
- addSimpleComponent("com.yahoo.container.core.documentapi.MessageBusDocumentAccessProvider");
+ addSimpleComponent(com.yahoo.container.core.documentapi.DocumentAccessProvider.class.getName());
addMetricsHandlers();
addTestrunnerComponentsIfTester(deployState);
}
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 99ae6184f5c..3baf792dfba 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
@@ -25,7 +25,8 @@ public class DocumentApiOptionsBuilder {
getBindings(spec),
threadpoolOptions(spec, "rest-api"),
threadpoolOptions(spec, "http-client-api"),
- deployState.getProperties().feedCoreThreadPoolSizeFactor());
+ deployState.getProperties().feedCoreThreadPoolSizeFactor(),
+ deployState.getProperties().useNewRestapiHandler());
}
private static ContainerThreadpool.UserOptions threadpoolOptions(Element spec, String elementName) {
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/builder/xml/dom/ContentBuilderTest.java b/config-model/src/test/java/com/yahoo/vespa/model/builder/xml/dom/ContentBuilderTest.java
index 443bd2433c1..10049daa541 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/builder/xml/dom/ContentBuilderTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/builder/xml/dom/ContentBuilderTest.java
@@ -229,7 +229,6 @@ public class ContentBuilderTest extends DomBuilderTest {
/* Not yet
assertNotNull(h.getService("qrserver"));
- assertNotNull(h.getService("topleveldisptach"));
assertNotNull(h.getService("docproc"));
*/
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/IndexedTest.java b/config-model/src/test/java/com/yahoo/vespa/model/content/IndexedTest.java
index 504c3d9ba9c..5d4756c430d 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/content/IndexedTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/content/IndexedTest.java
@@ -143,7 +143,7 @@ public class IndexedTest extends ContentBaseTest {
// HostResource h = model.getHostSystem().getHosts().get(0);
// String [] expectedServices = {"logserver", "configserver", "adminserver", "slobrok",
// "logd", "configproxy","config-sentinel",
- // "qrserver", "fleetcontroller", "topleveldispatch",
+ // "qrserver", "fleetcontroller",
// "storagenode", "searchnode", "distributor", "transactionlogserver"};
// DomContentBuilderTest.assertServices(h, expectedServices);
Routing routing = model.getRouting();