diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-05-20 12:18:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-20 12:18:58 +0200 |
commit | 09556b0ee220c786271509833f2dc7e19fe9852e (patch) | |
tree | c8eb7ee2c89fcc93d03131a271878a50255824cd /config-model | |
parent | a721283dd69afc346d2138bcec4e6aef2d66fd03 (diff) | |
parent | 034146bc6de7babdeecae443480f11cba4c3461b (diff) |
Merge branch 'master' into balder/topk-probability-four-nines
Diffstat (limited to 'config-model')
6 files changed, 24 insertions, 40 deletions
diff --git a/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java b/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java index 035c16b70ba..b06022ba714 100644 --- a/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java +++ b/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java @@ -37,7 +37,6 @@ public class TestProperties implements ModelContext.Properties { private Zone zone; private Set<ContainerEndpoint> endpoints = Collections.emptySet(); private boolean useDedicatedNodeForLogserver = false; - private boolean useAdaptiveDispatch = false; private boolean useDistributorBtreeDb = false; private boolean useThreePhaseUpdates = false; private double defaultTermwiseLimit = 1.0; @@ -60,7 +59,6 @@ public class TestProperties implements ModelContext.Properties { @Override public boolean isBootstrap() { return false; } @Override public boolean isFirstTimeDeployment() { return false; } - @Override public boolean useAdaptiveDispatch() { return useAdaptiveDispatch; } @Override public boolean useDedicatedNodeForLogserver() { return useDedicatedNodeForLogserver; } @Override public Optional<EndpointCertificateSecrets> endpointCertificateSecrets() { return endpointCertificateSecrets; } @Override public double defaultTermwiseLimit() { return defaultTermwiseLimit; } @@ -123,11 +121,6 @@ public class TestProperties implements ModelContext.Properties { return this; } - public TestProperties setUseAdaptiveDispatch(boolean useAdaptiveDispatch) { - this.useAdaptiveDispatch = useAdaptiveDispatch; - return this; - } - public TestProperties setMultitenant(boolean multitenant) { this.multitenant = multitenant; return this; 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 4c4b1ca7f82..8002f89a2e7 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 @@ -5,10 +5,12 @@ import com.yahoo.container.QrSearchersConfig; import com.yahoo.prelude.semantics.SemanticRulesConfig; import com.yahoo.search.config.IndexInfoConfig; import com.yahoo.search.pagetemplates.PageTemplatesConfig; +import com.yahoo.search.query.profile.compiled.CompiledQueryProfileRegistry; import com.yahoo.search.query.profile.config.QueryProfilesConfig; import com.yahoo.vespa.configdefinition.IlscriptsConfig; import com.yahoo.vespa.model.container.ApplicationContainerCluster; import com.yahoo.vespa.model.container.component.ContainerSubsystem; +import com.yahoo.vespa.model.container.component.SimpleComponent; import com.yahoo.vespa.model.container.search.searchchain.LocalProvider; import com.yahoo.vespa.model.container.search.searchchain.SearchChains; import com.yahoo.vespa.model.search.AbstractSearchCluster; @@ -34,6 +36,8 @@ public class ContainerSearch extends ContainerSubsystem<SearchChains> SemanticRulesConfig.Producer, PageTemplatesConfig.Producer { + public static final String QUERY_PROFILE_REGISTRY_CLASS = CompiledQueryProfileRegistry.class.getName(); + private ApplicationContainerCluster owningCluster; private final List<AbstractSearchCluster> searchClusters = new LinkedList<>(); private final Options options; @@ -46,6 +50,8 @@ public class ContainerSearch extends ContainerSubsystem<SearchChains> super(chains); this.owningCluster = cluster; this.options = options; + + owningCluster.addComponent(new SimpleComponent(QUERY_PROFILE_REGISTRY_CLASS)); } public void connectSearchClusters(Map<String, AbstractSearchCluster> searchClusters) { diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/IndexedSearchCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/search/IndexedSearchCluster.java index 1f980949738..5e5976c4b9c 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/search/IndexedSearchCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/search/IndexedSearchCluster.java @@ -52,7 +52,6 @@ public class IndexedSearchCluster extends SearchCluster private final DispatchGroup rootDispatch; private DispatchSpec dispatchSpec; - private final boolean useAdaptiveDispatch; private List<SearchNode> searchNodes = new ArrayList<>(); /** @@ -69,7 +68,6 @@ public class IndexedSearchCluster extends SearchCluster super(parent, clusterName, index); unionCfg = new UnionConfiguration(this, documentDbs); rootDispatch = new DispatchGroup(this); - useAdaptiveDispatch = deployState.getProperties().useAdaptiveDispatch(); } @Override @@ -305,8 +303,6 @@ public class IndexedSearchCluster extends SearchCluster nodeBuilder.port(node.getRpcPort()); builder.node(nodeBuilder); } - if (useAdaptiveDispatch) - builder.distributionPolicy(DistributionPolicy.ADAPTIVE); if (tuning.dispatch.getTopkProbability() != null) { builder.topKProbability(tuning.dispatch.getTopkProbability()); } diff --git a/config-model/src/test/java/com/yahoo/vespa/model/container/xml/SearchBuilderTest.java b/config-model/src/test/java/com/yahoo/vespa/model/container/xml/SearchBuilderTest.java index 47f37a75fd0..a2d13439f4e 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/container/xml/SearchBuilderTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/container/xml/SearchBuilderTest.java @@ -1,6 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.container.xml; +import com.yahoo.component.ComponentId; import com.yahoo.config.model.builder.xml.test.DomBuilderTest; import com.yahoo.container.core.ChainsConfig; import com.yahoo.container.jdisc.JdiscBindingsConfig; @@ -16,6 +17,7 @@ import org.w3c.dom.Element; import static com.yahoo.config.model.api.container.ContainerServiceType.QRSERVER; import static com.yahoo.test.Matchers.hasItemWithMethod; +import static com.yahoo.vespa.model.container.search.ContainerSearch.QUERY_PROFILE_REGISTRY_CLASS; import static com.yahoo.vespa.model.container.xml.ContainerModelBuilder.SEARCH_HANDLER_BINDING; import static com.yahoo.vespa.model.container.xml.ContainerModelBuilder.SEARCH_HANDLER_CLASS; import static org.hamcrest.CoreMatchers.is; @@ -127,6 +129,14 @@ public class SearchBuilderTest extends ContainerModelBuilderTestBase { assertThat(chainsConfig().chains(), hasItemWithMethod("vespa", "id")); } + @Test + public void query_profiles_registry_component_is_added() { + createClusterWithOnlyDefaultChains(); + ApplicationContainerCluster cluster = (ApplicationContainerCluster)root.getChildren().get("default"); + var queryProfileRegistryId = ComponentId.fromString(QUERY_PROFILE_REGISTRY_CLASS); + assertTrue(cluster.getComponentsMap().containsKey(queryProfileRegistryId)); + } + private void createClusterWithOnlyDefaultChains() { Element containerElem = DomBuilderTest.parse( "<container id='default' version='1.0'>", diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java index 5633e1a5eec..5b3c42df869 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java @@ -310,14 +310,14 @@ public class ContentClusterTest extends ContentBaseTest { StorDistributormanagerConfig.Builder builder = new StorDistributormanagerConfig.Builder(); model.getConfig(builder, "bar/distributor/0"); StorDistributormanagerConfig config = new StorDistributormanagerConfig(builder); - assertEquals(false, config.inlinebucketsplitting()); + assertFalse(config.inlinebucketsplitting()); } { StorFilestorConfig.Builder builder = new StorFilestorConfig.Builder(); model.getConfig(builder, "bar/storage/0"); StorFilestorConfig config = new StorFilestorConfig(builder); - assertEquals(false, config.enable_multibit_split_optimalization()); + assertFalse(config.enable_multibit_split_optimalization()); } } @@ -343,7 +343,7 @@ public class ContentClusterTest extends ContentBaseTest { List<String> sds = ApplicationPackageUtils.generateSchemas("type1", "type2"); try{ new VespaModelCreatorWithMockPkg(getHosts(), xml, sds).create(); - assertTrue("Deploying without redundancy should fail", false); + fail("Deploying without redundancy should fail"); } catch (IllegalArgumentException e) { assertTrue(e.getMessage(), e.getMessage().contains("missing required element \"redundancy\"")); } @@ -773,7 +773,7 @@ public class ContentClusterTest extends ContentBaseTest { " <documents/>" + " <engine>" + " <proton>" + - " <flush-on-shutdown>" + Boolean.toString(flushOnShutdown) + "</flush-on-shutdown>" + + " <flush-on-shutdown>" + flushOnShutdown + "</flush-on-shutdown>" + " </proton>" + " </engine>" + " <group>" + @@ -944,27 +944,6 @@ public class ContentClusterTest extends ContentBaseTest { assertEquals(0.9999, cfg.topKProbability(), 0.0); } - private void verifyRoundRobinPropertiesControl(boolean useAdaptiveDispatch) { - VespaModel model = createEnd2EndOneNode(new TestProperties().setUseAdaptiveDispatch(useAdaptiveDispatch)); - - ContentCluster cc = model.getContentClusters().get("storage"); - DispatchConfig.Builder builder = new DispatchConfig.Builder(); - cc.getSearch().getConfig(builder); - - DispatchConfig cfg = new DispatchConfig(builder); - if (useAdaptiveDispatch) { - assertEquals(DispatchConfig.DistributionPolicy.ADAPTIVE, cfg.distributionPolicy()); - } else { - assertEquals(DispatchConfig.DistributionPolicy.ROUNDROBIN, cfg.distributionPolicy()); - } - } - - @Test - public void default_dispatch_controlled_by_properties() { - verifyRoundRobinPropertiesControl(false); - verifyRoundRobinPropertiesControl(true); - } - @Test public void default_topKprobability_controlled_by_properties() { verifyTopKProbabilityPropertiesControl(); diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/cluster/ClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/content/cluster/ClusterTest.java index b61159e2a4c..7c93b4ef02b 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/content/cluster/ClusterTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/content/cluster/ClusterTest.java @@ -65,7 +65,7 @@ public class ClusterTest { assertEquals(0.23, config.minWaitAfterCoverageFactor(), DELTA); assertEquals(0.58, config.maxWaitAfterCoverageFactor(), DELTA); assertEquals(2, config.searchableCopies()); - assertEquals(DispatchConfig.DistributionPolicy.ROUNDROBIN, config.distributionPolicy()); + assertEquals(DispatchConfig.DistributionPolicy.ADAPTIVE, config.distributionPolicy()); } @Test @@ -74,7 +74,7 @@ public class ClusterTest { "", joinLines( "<max-hits-per-partition>77</max-hits-per-partition>", - "<dispatch-policy>adaptive</dispatch-policy>", + "<dispatch-policy>round-robin</dispatch-policy>", "<min-group-coverage>13</min-group-coverage>", "<min-active-docs-coverage>93</min-active-docs-coverage>", "<top-k-probability>0.777</top-k-probability>"), @@ -85,7 +85,7 @@ public class ClusterTest { assertEquals(2, config.searchableCopies()); assertEquals(93.0, config.minActivedocsPercentage(), DELTA); assertEquals(13.0, config.minGroupCoverage(), DELTA); - assertEquals(DispatchConfig.DistributionPolicy.ADAPTIVE, config.distributionPolicy()); + assertEquals(DispatchConfig.DistributionPolicy.ROUNDROBIN, config.distributionPolicy()); assertEquals(77, config.maxHitsPerNode()); assertEquals(0.777, config.topKProbability(), DELTA); } @@ -98,7 +98,7 @@ public class ClusterTest { cluster.getSearch().getConfig(builder); DispatchConfig config = new DispatchConfig(builder); assertEquals(2, config.searchableCopies()); - assertEquals(DispatchConfig.DistributionPolicy.ROUNDROBIN, config.distributionPolicy()); + assertEquals(DispatchConfig.DistributionPolicy.ADAPTIVE, config.distributionPolicy()); assertEquals(0, config.maxNodesDownPerGroup()); assertEquals(1.0, config.maxWaitAfterCoverageFactor(), DELTA); assertEquals(0, config.minWaitAfterCoverageFactor(), DELTA); |