From 235c044e4c89672db20507a9b06b44fd331bb47e Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Tue, 19 May 2020 21:41:28 +0000 Subject: Set top-k-probability to 0.9999 --- .../java/com/yahoo/config/model/deploy/TestProperties.java | 7 ------- .../com/yahoo/vespa/model/search/IndexedSearchCluster.java | 4 ---- .../java/com/yahoo/vespa/model/content/ContentClusterTest.java | 10 ++++------ .../com/yahoo/vespa/model/content/cluster/ClusterTest.java | 5 ++++- 4 files changed, 8 insertions(+), 18 deletions(-) (limited to 'config-model') 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 b815b72f851..035c16b70ba 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 @@ -38,7 +38,6 @@ public class TestProperties implements ModelContext.Properties { private Set endpoints = Collections.emptySet(); private boolean useDedicatedNodeForLogserver = false; private boolean useAdaptiveDispatch = false; - private double topKProbability = 1.0; private boolean useDistributorBtreeDb = false; private boolean useThreePhaseUpdates = false; private double defaultTermwiseLimit = 1.0; @@ -81,7 +80,6 @@ public class TestProperties implements ModelContext.Properties { return softStartSeconds; } - @Override public double defaultTopKProbability() { return topKProbability; } @Override public boolean useDistributorBtreeDb() { return useDistributorBtreeDb; } @Override public boolean useThreePhaseUpdates() { return useThreePhaseUpdates; } @Override public Optional athenzDomain() { return Optional.ofNullable(athenzDomain); } @@ -92,11 +90,6 @@ public class TestProperties implements ModelContext.Properties { return this; } - public TestProperties setTopKProbability(double probability) { - topKProbability = probability; - return this; - } - public TestProperties setUseDistributorBtreeDB(boolean useBtreeDb) { useDistributorBtreeDb = useBtreeDb; return this; 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 56adc227df4..1f980949738 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 @@ -53,7 +53,6 @@ public class IndexedSearchCluster extends SearchCluster private final DispatchGroup rootDispatch; private DispatchSpec dispatchSpec; private final boolean useAdaptiveDispatch; - private final double defaultTopKProbability; private List searchNodes = new ArrayList<>(); /** @@ -71,7 +70,6 @@ public class IndexedSearchCluster extends SearchCluster unionCfg = new UnionConfiguration(this, documentDbs); rootDispatch = new DispatchGroup(this); useAdaptiveDispatch = deployState.getProperties().useAdaptiveDispatch(); - defaultTopKProbability = deployState.getProperties().defaultTopKProbability(); } @Override @@ -311,8 +309,6 @@ public class IndexedSearchCluster extends SearchCluster builder.distributionPolicy(DistributionPolicy.ADAPTIVE); if (tuning.dispatch.getTopkProbability() != null) { builder.topKProbability(tuning.dispatch.getTopkProbability()); - } else { - builder.topKProbability(defaultTopKProbability); } if (tuning.dispatch.getMinActiveDocsCoverage() != null) builder.minActivedocsPercentage(tuning.dispatch.getMinActiveDocsCoverage()); 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 802082cc2ff..5633e1a5eec 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 @@ -933,15 +933,15 @@ public class ContentClusterTest extends ContentBaseTest { assertEquals(distributionBits, storDistributormanagerConfig.minsplitcount()); } - private void verifyTopKProbabilityPropertiesControl(double topKProbability) { - VespaModel model = createEnd2EndOneNode(new TestProperties().setTopKProbability(topKProbability)); + private void verifyTopKProbabilityPropertiesControl() { + VespaModel model = createEnd2EndOneNode(new TestProperties()); ContentCluster cc = model.getContentClusters().get("storage"); DispatchConfig.Builder builder = new DispatchConfig.Builder(); cc.getSearch().getConfig(builder); DispatchConfig cfg = new DispatchConfig(builder); - assertEquals(topKProbability, cfg.topKProbability(), 0.0); + assertEquals(0.9999, cfg.topKProbability(), 0.0); } private void verifyRoundRobinPropertiesControl(boolean useAdaptiveDispatch) { @@ -967,9 +967,7 @@ public class ContentClusterTest extends ContentBaseTest { @Test public void default_topKprobability_controlled_by_properties() { - verifyTopKProbabilityPropertiesControl(1.0); - verifyTopKProbabilityPropertiesControl(0.999); - verifyTopKProbabilityPropertiesControl(0.77); + verifyTopKProbabilityPropertiesControl(); } private boolean resolveDistributorBtreeDbConfigWithFeatureFlag(boolean flagEnabledBtreeDb) { 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 852844fe451..b61159e2a4c 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 @@ -76,7 +76,8 @@ public class ClusterTest { "77", "adaptive", "13", - "93"), + "93", + "0.777"), false); DispatchConfig.Builder builder = new DispatchConfig.Builder(); cluster.getSearch().getConfig(builder); @@ -86,6 +87,7 @@ public class ClusterTest { assertEquals(13.0, config.minGroupCoverage(), DELTA); assertEquals(DispatchConfig.DistributionPolicy.ADAPTIVE, config.distributionPolicy()); assertEquals(77, config.maxHitsPerNode()); + assertEquals(0.777, config.topKProbability(), DELTA); } @Test @@ -105,6 +107,7 @@ public class ClusterTest { assertEquals(100.0, config.minSearchCoverage(), DELTA); assertEquals(97.0, config.minActivedocsPercentage(), DELTA); assertEquals(100.0, config.minGroupCoverage(), DELTA); + assertEquals(0.9999, config.topKProbability(), DELTA); assertEquals(3, config.node().size()); assertEquals(0, config.node(0).key()); assertEquals(1, config.node(1).key()); -- cgit v1.2.3