diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2024-01-17 11:20:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-17 11:20:32 +0100 |
commit | 580c6f72ca56fee1f424ceaffc94f6b43765e11e (patch) | |
tree | 4719d192e5aab011fe2640c59563372bfaa86c90 | |
parent | 282d9ecb5381317e4f56dd799fce52b45147414d (diff) | |
parent | 881387ff281e1cf2bb2f17b3888cf6f569ed1914 (diff) |
Merge pull request #29947 from vespa-engine/arnej/prepare-streaming-validation
Arnej/prepare streaming validation
2 files changed, 10 insertions, 5 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/RankSetupValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/RankSetupValidator.java index ebfce1353d2..f2d9c0fcd1c 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/RankSetupValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/RankSetupValidator.java @@ -5,7 +5,6 @@ import com.yahoo.cloud.config.ConfigserverConfig; import com.yahoo.collections.Pair; import com.yahoo.config.ConfigInstance; import com.yahoo.config.application.api.DeployLogger; -import com.yahoo.config.model.producer.AnyConfigProducer; import com.yahoo.io.IOUtils; import com.yahoo.log.InvalidLogFormatException; import com.yahoo.log.LogMessage; @@ -19,6 +18,7 @@ import com.yahoo.vespa.config.search.RankProfilesConfig; import com.yahoo.vespa.config.search.core.OnnxModelsConfig; import com.yahoo.vespa.config.search.core.RankingConstantsConfig; import com.yahoo.vespa.config.search.core.RankingExpressionsConfig; +import com.yahoo.vespa.config.search.vsm.VsmfieldsConfig; import com.yahoo.vespa.defaults.Defaults; import com.yahoo.vespa.model.application.validation.Validation.Context; import com.yahoo.vespa.model.search.DocumentDatabase; @@ -109,7 +109,11 @@ public class RankSetupValidator implements Validator { IOUtils.recursiveDeleteDir(dir); } - private void writeConfigs(String dir, AnyConfigProducer producer) throws IOException { + private void writeConfigs(String dir, DocumentDatabase producer) throws IOException { + var vsmFB = new VsmfieldsConfig.Builder(); + producer.getDerivedConfiguration().getVsmFields().getConfig(vsmFB); + writeConfig(dir, VsmfieldsConfig.getDefName() + ".cfg", vsmFB.build()); + RankProfilesConfig.Builder rpcb = new RankProfilesConfig.Builder(); ((RankProfilesConfig.Producer) producer).getConfig(rpcb); writeConfig(dir, RankProfilesConfig.getDefName() + ".cfg", rpcb.build()); 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 index f25ca7e4452..44551965a8c 100644 --- 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 @@ -42,6 +42,7 @@ public class StreamingSearchCluster extends SearchCluster implements private final AttributesProducer attributesConfig; private final String docTypeName; private DerivedConfiguration derivedConfig = null; + private DocumentDatabase derivedDb = null; public StreamingSearchCluster(TreeConfigProducer<AnyConfigProducer> parent, String clusterName, @@ -85,15 +86,15 @@ public class StreamingSearchCluster extends SearchCluster implements throw new IllegalArgumentException("Document type name '" + docTypeName + "' must be the same as the schema name '" + schema.getName() + "'"); this.derivedConfig = new DerivedConfiguration(schema, deployState, true); + this.derivedDb = new DocumentDatabase(this, docTypeName, this.derivedConfig); } @Override public List<DocumentDatabase> getDocumentDbs() { - if (derived() == null) { + if (derivedDb == null) { throw new IllegalArgumentException("missing derivedConfig"); } - var db = new DocumentDatabase(this, docTypeName, derived()); - return List.of(db); + return List.of(derivedDb); } @Override |