aboutsummaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2024-03-13 17:18:55 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2024-03-13 17:18:55 +0100
commit89d7ee5883f3f795aa72be3dfa86fdcad49a9aeb (patch)
treeb4201e6d11ad8e3c209b8fd5ab2455541ac2d62f /config-model
parent4528b9f815cf780fbda7ee0d041b8070a39d518d (diff)
Always produce routespec.
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/search/ContainerSearch.java6
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java8
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/search/StreamingSearchCluster.java100
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/builder/xml/dom/ContentBuilderTest.java1
4 files changed, 1 insertions, 114 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 035ae4a06f5..c98e2dac1d9 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
@@ -22,7 +22,6 @@ import com.yahoo.vespa.model.container.component.ContainerSubsystem;
import com.yahoo.vespa.model.container.search.searchchain.SearchChains;
import com.yahoo.vespa.model.search.IndexedSearchCluster;
import com.yahoo.vespa.model.search.SearchCluster;
-import com.yahoo.vespa.model.search.StreamingSearchCluster;
import java.util.Collection;
import java.util.HashSet;
@@ -179,10 +178,7 @@ public class ContainerSearch extends ContainerSubsystem<SearchChains>
}
scB.rankprofiles_configid(sys.getConfigId());
scB.indexingmode(QrSearchersConfig.Searchcluster.Indexingmode.Enum.valueOf(sys.getIndexingModeName()));
- if ( ! (sys instanceof IndexedSearchCluster)) {
- scB.storagecluster(new QrSearchersConfig.Searchcluster.Storagecluster.Builder().
- routespec(((StreamingSearchCluster)sys).getStorageRouteSpec()));
- }
+ scB.storagecluster(new QrSearchersConfig.Searchcluster.Storagecluster.Builder().routespec(sys.getStorageRouteSpec()));
builder.searchcluster(scB);
}
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java
index 9d2a7e722ff..e2fe660cbe9 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java
@@ -21,7 +21,6 @@ import com.yahoo.vespa.model.search.NodeSpec;
import com.yahoo.vespa.model.search.SchemaDefinitionXMLHandler;
import com.yahoo.vespa.model.search.SearchCluster;
import com.yahoo.vespa.model.search.SearchNode;
-import com.yahoo.vespa.model.search.StreamingSearchCluster;
import com.yahoo.vespa.model.search.TransactionLogServer;
import com.yahoo.vespa.model.search.Tuning;
import org.w3c.dom.Element;
@@ -298,13 +297,6 @@ public class ContentSearchCluster extends TreeConfigProducer<AnyConfigProducer>
this.redundancy = redundancy;
}
- public List<StreamingSearchCluster> getStreamingClusters() {
- return getClusters().values().stream()
- .filter(StreamingSearchCluster.class::isInstance)
- .map(StreamingSearchCluster.class::cast)
- .toList();
- }
-
public List<NewDocumentType> getDocumentTypesWithStreamingCluster() { return documentTypes(this::hasIndexingModeStreaming); }
public List<NewDocumentType> getDocumentTypesWithIndexedCluster() { return documentTypes(this::hasIndexingModeIndexed); }
public List<NewDocumentType> getDocumentTypesWithStoreOnly() { return documentTypes(this::hasIndexingModeStoreOnly); }
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/StreamingSearchCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/search/StreamingSearchCluster.java
deleted file mode 100644
index e188a086614..00000000000
--- a/config-model/src/main/java/com/yahoo/vespa/model/search/StreamingSearchCluster.java
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.model.search;
-
-import com.yahoo.config.model.deploy.DeployState;
-import com.yahoo.config.model.producer.AnyConfigProducer;
-import com.yahoo.config.model.producer.TreeConfigProducer;
-import com.yahoo.schema.Schema;
-import com.yahoo.schema.derived.AttributeFields;
-import com.yahoo.schema.derived.DerivedConfiguration;
-import com.yahoo.schema.derived.SchemaInfo;
-import com.yahoo.vespa.config.search.AttributesConfig;
-import com.yahoo.vespa.config.search.RankProfilesConfig;
-import com.yahoo.vespa.config.search.SummaryConfig;
-import com.yahoo.vespa.config.search.core.OnnxModelsConfig;
-import com.yahoo.vespa.config.search.core.ProtonConfig;
-import com.yahoo.vespa.config.search.core.RankingConstantsConfig;
-import com.yahoo.vespa.config.search.core.RankingExpressionsConfig;
-import com.yahoo.vespa.config.search.summary.JuniperrcConfig;
-import com.yahoo.vespa.config.search.vsm.VsmfieldsConfig;
-import com.yahoo.vespa.config.search.vsm.VsmsummaryConfig;
-
-/**
- * A search cluster of type streaming.
- *
- * @author baldersheim
- * @author vegardh
- */
-public class StreamingSearchCluster extends SearchCluster implements
- AttributesConfig.Producer,
- RankProfilesConfig.Producer,
- RankingConstantsConfig.Producer,
- RankingExpressionsConfig.Producer,
- OnnxModelsConfig.Producer,
- JuniperrcConfig.Producer,
- SummaryConfig.Producer,
- VsmsummaryConfig.Producer,
- VsmfieldsConfig.Producer
-{
- private final String storageRouteSpec;
- private final AttributesProducer attributesConfig;
- private final String docTypeName;
-
- public StreamingSearchCluster(TreeConfigProducer<AnyConfigProducer> parent, String clusterName, int index,
- String docTypeName, String storageRouteSpec) {
- super(parent, clusterName, index);
- attributesConfig = new AttributesProducer(parent, docTypeName);
- this.docTypeName = docTypeName;
- this.storageRouteSpec = storageRouteSpec;
- }
-
- @Override
- protected IndexingMode getIndexingMode() { return IndexingMode.STREAMING; }
- public final String getStorageRouteSpec() { return storageRouteSpec; }
-
- public String getDocTypeName() { return docTypeName; }
-
- public DerivedConfiguration derived() { return db().getDerivedConfiguration(); }
-
- @Override
- public void deriveFromSchemas(DeployState deployState) {
- if (schemas().isEmpty()) return;
- if (schemas().size() > 1) throw new IllegalArgumentException("Only a single schema is supported, got " + schemas().size());
-
- Schema schema = schemas().values().stream().findAny().get().fullSchema();
- if ( ! schema.getName().equals(docTypeName))
- throw new IllegalArgumentException("Document type name '" + docTypeName +
- "' must be the same as the schema name '" + schema.getName() + "'");
- add(new DocumentDatabase(this, docTypeName, new DerivedConfiguration(deployState, schema, SchemaInfo.IndexMode.STREAMING)));
- }
-
- protected void fillDocumentDBConfig(DocumentDatabase sdoc, ProtonConfig.Documentdb.Builder ddbB) {
- super.fillDocumentDBConfig(sdoc, ddbB);
- ddbB.configid(attributesConfig.getConfigId()); // Temporary until fully cleaned up
- }
-
- private DocumentDatabase db() { return getDocumentDbs().get(0); }
-
- // These are temporary until backend uses correct config id.
- @Override public void getConfig(SummaryConfig.Builder builder) { db().getConfig(builder); }
- @Override public void getConfig(OnnxModelsConfig.Builder builder) { db().getConfig(builder); }
- @Override public void getConfig(RankingConstantsConfig.Builder builder) { db().getConfig(builder); }
- @Override public void getConfig(RankProfilesConfig.Builder builder) { db().getConfig(builder); }
- @Override public void getConfig(RankingExpressionsConfig.Builder builder) { db().getConfig(builder); }
- @Override public void getConfig(JuniperrcConfig.Builder builder) { db().getConfig(builder); }
- @Override public void getConfig(VsmfieldsConfig.Builder builder) { db().getConfig(builder); }
- @Override public void getConfig(VsmsummaryConfig.Builder builder) { db().getConfig(builder);}
-
- private class AttributesProducer extends AnyConfigProducer implements AttributesConfig.Producer {
-
- AttributesProducer(TreeConfigProducer<AnyConfigProducer> parent, String docType) {
- super(parent, docType);
- }
-
- @Override
- public void getConfig(AttributesConfig.Builder builder) {
- derived().getConfig(builder, AttributeFields.FieldSet.FAST_ACCESS);
- }
- }
-
-}
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 0fd535816b1..327b169a629 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
@@ -22,7 +22,6 @@ import com.yahoo.vespa.model.content.engines.ProtonEngine;
import com.yahoo.vespa.model.search.IndexedSearchCluster;
import com.yahoo.vespa.model.search.SearchCluster;
import com.yahoo.vespa.model.search.SearchNode;
-import com.yahoo.vespa.model.search.StreamingSearchCluster;
import com.yahoo.vespa.model.test.utils.VespaModelCreatorWithMockPkg;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;