diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-09-30 09:05:30 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-09-30 09:05:30 +0200 |
commit | d8d16951fb67b7f8a9dafe8c75ac927e83cf697a (patch) | |
tree | 9d66c602d364dc5d174407a0bc2e4d4669266ab8 /config-model | |
parent | 2f2613db7ed3d7e2f3f9ee01fc46683bd3c0295a (diff) |
No configuration of phrase splitting needed.
Diffstat (limited to 'config-model')
3 files changed, 17 insertions, 23 deletions
diff --git a/config-model/src/main/java/com/yahoo/schema/RankProfile.java b/config-model/src/main/java/com/yahoo/schema/RankProfile.java index dc7605c4897..31c68d2f2c8 100644 --- a/config-model/src/main/java/com/yahoo/schema/RankProfile.java +++ b/config-model/src/main/java/com/yahoo/schema/RankProfile.java @@ -144,7 +144,7 @@ public class RankProfile implements Cloneable { public RankProfile(String name, Schema schema, RankProfileRegistry rankProfileRegistry) { this(name, Objects.requireNonNull(schema, "schema cannot be null"), schema.applicationPackage(), schema.getDeployLogger(), - schema.getDeployProperties(), rankProfileRegistry); + rankProfileRegistry); } /** @@ -153,17 +153,12 @@ public class RankProfile implements Cloneable { * @param name the name of the new profile */ public RankProfile(String name, Schema schema, ApplicationPackage applicationPackage, DeployLogger deployLogger, - ModelContext.Properties deployProperties, RankProfileRegistry rankProfileRegistry) { + RankProfileRegistry rankProfileRegistry) { this.name = Objects.requireNonNull(name, "name cannot be null"); this.schema = schema; this.rankProfileRegistry = rankProfileRegistry; this.applicationPackage = applicationPackage; this.deployLogger = deployLogger; - if (deployProperties.featureFlags().phraseOptimization().contains("split")) { - addRankProperty(new RankProperty("vespa.matching.split_unpacking_iterators", "true")); - } else if (deployProperties.featureFlags().phraseOptimization().contains("off")) { - addRankProperty(new RankProperty("vespa.matching.split_unpacking_iterators", "false")); - } } public String name() { return name; } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java b/config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java index c9b462ce30b..86402981898 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java @@ -53,6 +53,7 @@ import com.yahoo.vespa.model.ml.ConvertedModel; import com.yahoo.vespa.model.ml.ModelName; import com.yahoo.vespa.model.ml.OnnxModelInfo; import com.yahoo.vespa.model.routing.Routing; +import com.yahoo.vespa.model.search.DocumentDatabase; import com.yahoo.vespa.model.search.SearchCluster; import com.yahoo.vespa.model.utils.internal.ReflectionUtil; import org.xml.sax.SAXException; @@ -190,21 +191,21 @@ public final class VespaModel extends AbstractConfigProducerRoot implements Mode @Override public Map<String, Set<String>> documentTypesByCluster() { return getContentClusters().entrySet().stream() - .collect(toMap(cluster -> cluster.getKey(), + .collect(toMap(Map.Entry::getKey, cluster -> cluster.getValue().getDocumentDefinitions().keySet())); } @Override public Map<String, Set<String>> indexedDocumentTypesByCluster() { return getContentClusters().entrySet().stream() - .collect(toUnmodifiableMap(cluster -> cluster.getKey(), + .collect(toUnmodifiableMap(Map.Entry::getKey, cluster -> documentTypesWithIndex(cluster.getValue()))); } private static Set<String> documentTypesWithIndex(ContentCluster content) { Set<String> typesWithIndexMode = content.getSearch().getDocumentTypesWithIndexedCluster().stream() .map(type -> type.getFullName().getName()) - .collect(Collectors.toCollection(() -> new LinkedHashSet<>())); + .collect(Collectors.toCollection(LinkedHashSet::new)); Set<String> typesWithIndexedFields = content.getSearch().getIndexed() == null ? Set.of() @@ -213,11 +214,11 @@ public final class VespaModel extends AbstractConfigProducerRoot implements Mode .getSchema() .allConcreteFields() .stream().anyMatch(SDField::doesIndexing)) - .map(database -> database.getSchemaName()) - .collect(Collectors.toCollection(() -> new LinkedHashSet<>())); + .map(DocumentDatabase::getSchemaName) + .collect(Collectors.toCollection(LinkedHashSet::new)); return typesWithIndexMode.stream().filter(typesWithIndexedFields::contains) - .collect(Collectors.toCollection(() -> new LinkedHashSet<>())); + .collect(Collectors.toCollection(LinkedHashSet::new)); } private void propagateRestartOnDeploy() { @@ -258,13 +259,12 @@ public final class VespaModel extends AbstractConfigProducerRoot implements Mode DeployLogger deployLogger = deployState.getDeployLogger(); RankProfileRegistry rankProfileRegistry = deployState.rankProfileRegistry(); QueryProfiles queryProfiles = deployState.getQueryProfiles(); - ModelContext.Properties deployProperties = deployState.getProperties(); List <Future<ConvertedModel>> futureModels = new ArrayList<>(); if ( ! importedModels.isEmpty()) { // models/ directory is available for (ImportedMlModel model : importedModels) { // Due to automatic naming not guaranteeing unique names, there must be a 1-1 between OnnxModels and global RankProfiles. RankProfile profile = new RankProfile(model.name(), null, applicationPackage, - deployLogger, deployProperties, rankProfileRegistry); + deployLogger, rankProfileRegistry); addOnnxModelInfoFromSource(model, profile); rankProfileRegistry.add(profile); futureModels.add(deployState.getExecutor().submit(() -> { @@ -282,7 +282,7 @@ public final class VespaModel extends AbstractConfigProducerRoot implements Mode if (modelName.contains(".")) continue; // Name space: Not a global profile // Due to automatic naming not guaranteeing unique names, there must be a 1-1 between OnnxModels and global RankProfiles. RankProfile profile = new RankProfile(modelName, null, applicationPackage, - deployLogger, deployProperties, rankProfileRegistry); + deployLogger, rankProfileRegistry); addOnnxModelInfoFromStore(modelName, profile); rankProfileRegistry.add(profile); futureModels.add(deployState.getExecutor().submit(() -> { @@ -430,7 +430,7 @@ public final class VespaModel extends AbstractConfigProducerRoot implements Mode * * @param configId a config id */ - protected void checkId(String configId) { + private void checkId(String configId) { if ( ! id2producer.containsKey(configId)) { log.log(Level.FINE, () -> "Invalid config id: " + configId); } @@ -657,7 +657,7 @@ public final class VespaModel extends AbstractConfigProducerRoot implements Mode .map(HostResource::spec) .filter(spec -> spec.membership().isPresent()) .map(spec -> spec.membership().get().cluster().id()) - .collect(Collectors.toCollection(() -> new LinkedHashSet<>())); + .collect(Collectors.toCollection(LinkedHashSet::new)); } @Override diff --git a/config-model/src/test/java/com/yahoo/schema/RankPropertiesTestCase.java b/config-model/src/test/java/com/yahoo/schema/RankPropertiesTestCase.java index a19918d83d2..26e67eaa5ec 100644 --- a/config-model/src/test/java/com/yahoo/schema/RankPropertiesTestCase.java +++ b/config-model/src/test/java/com/yahoo/schema/RankPropertiesTestCase.java @@ -14,6 +14,7 @@ import java.util.List; import static com.yahoo.config.model.test.TestUtil.joinLines; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * @author bratseth @@ -106,13 +107,11 @@ public class RankPropertiesTestCase extends AbstractSchemaTestCase { builder.build(true); Schema schema = builder.getSchema(); List<RankProfile.RankProperty> props = rankProfileRegistry.get(schema, "a").getRankProperties(); - assertEquals(1, props.size()); - assertEquals(new RankProfile.RankProperty("vespa.matching.split_unpacking_iterators","true"), props.get(0)); + assertTrue(props.isEmpty()); props = rankProfileRegistry.get(schema, "b").getRankProperties(); - assertEquals(2, props.size()); - assertEquals(new RankProfile.RankProperty("vespa.matching.split_unpacking_iterators","true"), props.get(0)); - assertEquals(new RankProfile.RankProperty("query(a)","2000"), props.get(1)); + assertEquals(1, props.size()); + assertEquals(new RankProfile.RankProperty("query(a)","2000"), props.get(0)); } @Test |