diff options
author | Jon Bratseth <bratseth@gmail.com> | 2022-05-12 10:04:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-12 10:04:27 +0200 |
commit | 5ae6888a95c372a2f121c38d66a5b16c57f3548d (patch) | |
tree | 1299433dc8fec50e6d3be20ae465aca083dd93d1 /config-model/src/main/java/com/yahoo/searchdefinition/derived/DerivedConfiguration.java | |
parent | 2e2bc6d5cbda0c3752a25eb4ed61a5cef89a0480 (diff) |
Revert "Revert "Pass DeployState""
Diffstat (limited to 'config-model/src/main/java/com/yahoo/searchdefinition/derived/DerivedConfiguration.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/searchdefinition/derived/DerivedConfiguration.java | 45 |
1 files changed, 14 insertions, 31 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/derived/DerivedConfiguration.java b/config-model/src/main/java/com/yahoo/searchdefinition/derived/DerivedConfiguration.java index 0c7c507f32d..8dec0e8339a 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/derived/DerivedConfiguration.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/derived/DerivedConfiguration.java @@ -1,13 +1,8 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.searchdefinition.derived; -import ai.vespa.rankingexpression.importer.configmodelview.ImportedMlModels; -import com.yahoo.concurrent.InThreadExecutorService; import com.yahoo.config.ConfigInstance; -import com.yahoo.config.model.api.ModelContext; -import com.yahoo.config.model.application.provider.BaseDeployLogger; -import com.yahoo.config.application.api.DeployLogger; -import com.yahoo.config.model.deploy.TestProperties; +import com.yahoo.config.model.deploy.DeployState; import com.yahoo.document.config.DocumenttypesConfig; import com.yahoo.document.config.DocumentmanagerConfig; import com.yahoo.io.IOUtils; @@ -21,7 +16,6 @@ import com.yahoo.vespa.model.container.search.QueryProfiles; import java.io.IOException; import java.io.Writer; -import java.util.concurrent.ExecutorService; /** * A set of all derived configuration of a schema. Use this as a facade to individual configurations when @@ -62,47 +56,36 @@ public class DerivedConfiguration implements AttributesConfig.Producer { } DerivedConfiguration(Schema schema, RankProfileRegistry rankProfileRegistry, QueryProfileRegistry queryProfiles) { - this(schema, new BaseDeployLogger(), new TestProperties(), rankProfileRegistry, queryProfiles, new ImportedMlModels(), new InThreadExecutorService()); + this(schema, new DeployState.Builder().rankProfileRegistry(rankProfileRegistry).queryProfiles(queryProfiles).build()); } /** - * Creates a complete derived configuration snapshot from a search definition. + * Creates a complete derived configuration snapshot from a schema. * - * @param schema the search to derive a configuration from. Derived objects will be snapshots, but this - * argument is live. Which means that this object will be inconsistent when the given - * search definition is later modified. - * @param deployLogger a {@link DeployLogger} for logging when doing operations on this - * @param deployProperties properties set on deploy - * @param rankProfileRegistry a {@link com.yahoo.searchdefinition.RankProfileRegistry} - * @param queryProfiles the query profiles of this application + * @param schema the schema to derive a configuration from. Derived objects will be snapshots, but this + * argument is live. Which means that this object will be inconsistent if the given + * schema is later modified. */ - public DerivedConfiguration(Schema schema, - DeployLogger deployLogger, - ModelContext.Properties deployProperties, - RankProfileRegistry rankProfileRegistry, - QueryProfileRegistry queryProfiles, - ImportedMlModels importedModels, - ExecutorService executor) { - Validator.ensureNotNull("Search definition", schema); + public DerivedConfiguration(Schema schema, DeployState deployState) { + Validator.ensureNotNull("Schema", schema); this.schema = schema; - this.queryProfiles = queryProfiles; - this.maxUncommittedMemory = deployProperties.featureFlags().maxUnCommittedMemory(); - this.enableBitVectors = deployProperties.featureFlags().enableBitVectors(); + this.queryProfiles = deployState.getQueryProfiles().getRegistry(); + this.maxUncommittedMemory = deployState.getProperties().featureFlags().maxUnCommittedMemory(); + this.enableBitVectors = deployState.getProperties().featureFlags().enableBitVectors(); if ( ! schema.isDocumentsOnly()) { streamingFields = new VsmFields(schema); streamingSummary = new VsmSummary(schema); } if ( ! schema.isDocumentsOnly()) { attributeFields = new AttributeFields(schema); - summaries = new Summaries(schema, deployLogger, deployProperties.featureFlags()); + summaries = new Summaries(schema, deployState.getDeployLogger(), deployState.getProperties().featureFlags()); summaryMap = new SummaryMap(schema); juniperrc = new Juniperrc(schema); rankProfileList = new RankProfileList(schema, schema.rankingConstants(), schema.rankExpressionFiles(), - schema.onnxModels(), attributeFields, rankProfileRegistry, - queryProfiles, importedModels, deployProperties, executor); + schema.onnxModels(), attributeFields, deployState); indexingScript = new IndexingScript(schema); indexInfo = new IndexInfo(schema); - schemaInfo = new SchemaInfo(schema, rankProfileRegistry, summaries, summaryMap); + schemaInfo = new SchemaInfo(schema, deployState.rankProfileRegistry(), summaries, summaryMap); indexSchema = new IndexSchema(schema); importedFields = new ImportedFields(schema); } |