summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorjonmv <venstad@gmail.com>2023-07-14 09:27:22 +0200
committerjonmv <venstad@gmail.com>2023-07-14 09:27:22 +0200
commit9c208cbc41ae710b6bacbd34455b386d27ad7781 (patch)
treead34fd10c923aa3ea96b078f1cfe69bab2482890 /config-model
parent03074301a808b0f576a616665e8fb1e12884ea86 (diff)
Set up reconfigurable dispatcher with self-subscription instead
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/search/ContainerSearch.java10
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/search/DispatcherComponent.java9
2 files changed, 12 insertions, 7 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/search/ContainerSearch.java b/config-model/src/main/java/com/yahoo/vespa/model/container/search/ContainerSearch.java
index 414d4c817c7..728b4d40bdd 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/search/ContainerSearch.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/search/ContainerSearch.java
@@ -6,6 +6,8 @@ import com.yahoo.container.QrSearchersConfig;
import com.yahoo.prelude.semantics.SemanticRulesConfig;
import com.yahoo.search.config.IndexInfoConfig;
import com.yahoo.search.config.SchemaInfoConfig;
+import com.yahoo.search.dispatch.Dispatcher;
+import com.yahoo.search.dispatch.ReconfigurableDispatcher;
import com.yahoo.search.pagetemplates.PageTemplatesConfig;
import com.yahoo.search.query.profile.config.QueryProfilesConfig;
import com.yahoo.search.ranking.RankProfilesEvaluatorFactory;
@@ -81,16 +83,18 @@ public class ContainerSearch extends ContainerSubsystem<SearchChains>
/** Adds a Dispatcher component to the owning container cluster for each search cluster */
private void initializeDispatchers(Collection<SearchCluster> searchClusters) {
+ boolean useReconfigurableDispatch = false;
+ Class<? extends Dispatcher> dispatcherClass = useReconfigurableDispatch ? ReconfigurableDispatcher.class : Dispatcher.class;
for (SearchCluster searchCluster : searchClusters) {
if (searchCluster instanceof IndexedSearchCluster indexed) {
- var dispatcher = new DispatcherComponent(indexed);
+ var dispatcher = new DispatcherComponent(indexed, dispatcherClass);
owningCluster.addComponent(dispatcher);
}
if (globalPhase) {
for (var documentDb : searchCluster.getDocumentDbs()) {
- if (!schemasWithGlobalPhase.contains(documentDb.getSchemaName())) continue;
+ if ( ! schemasWithGlobalPhase.contains(documentDb.getSchemaName())) continue;
var factory = new RankProfilesEvaluatorComponent(documentDb);
- if (! owningCluster.getComponentsMap().containsKey(factory.getComponentId())) {
+ if ( ! owningCluster.getComponentsMap().containsKey(factory.getComponentId())) {
owningCluster.addComponent(factory);
}
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/search/DispatcherComponent.java b/config-model/src/main/java/com/yahoo/vespa/model/container/search/DispatcherComponent.java
index f9a3a1f1990..fe2df8101bd 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/search/DispatcherComponent.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/search/DispatcherComponent.java
@@ -3,6 +3,7 @@ package com.yahoo.vespa.model.container.search;
import com.yahoo.config.model.producer.TreeConfigProducer;
import com.yahoo.osgi.provider.model.ComponentModel;
+import com.yahoo.search.dispatch.Dispatcher;
import com.yahoo.vespa.config.search.DispatchConfig;
import com.yahoo.vespa.config.search.DispatchNodesConfig;
import com.yahoo.vespa.model.container.component.Component;
@@ -22,15 +23,15 @@ public class DispatcherComponent extends Component<TreeConfigProducer<?>, Compon
private final IndexedSearchCluster indexedSearchCluster;
- public DispatcherComponent(IndexedSearchCluster indexedSearchCluster) {
- super(toComponentModel(indexedSearchCluster.getClusterName()));
+ public DispatcherComponent(IndexedSearchCluster indexedSearchCluster, Class<? extends Dispatcher> clazz) {
+ super(toComponentModel(indexedSearchCluster.getClusterName(), clazz));
this.indexedSearchCluster = indexedSearchCluster;
}
- private static ComponentModel toComponentModel(String clusterName) {
+ private static ComponentModel toComponentModel(String clusterName, Class<? extends Dispatcher> clazz) {
String dispatcherComponentId = "dispatcher." + clusterName; // used by ClusterSearcher
return new ComponentModel(dispatcherComponentId,
- com.yahoo.search.dispatch.Dispatcher.class.getName(),
+ clazz.getName(),
PlatformBundles.SEARCH_AND_DOCPROC_BUNDLE);
}