diff options
author | Geir Storli <geirstorli@yahoo.no> | 2018-05-08 12:54:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-08 12:54:02 +0200 |
commit | 33f6b0006529d7774bfcded130afb64fa9852a11 (patch) | |
tree | 6abd7683cc2a1bfef8583f9a875c101ec131dcde /config-model | |
parent | b018ae8acb13fde2ab331aa6f4a6ee6934cd6636 (diff) | |
parent | 264728fdda5b4b3ef7655f3221b5ad75d1cfbff3 (diff) |
Merge pull request #5806 from vespa-engine/balder/use-searchable-copies-for-coverage-estimate
Balder/use searchable copies for coverage estimate
Diffstat (limited to 'config-model')
7 files changed, 25 insertions, 5 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java index 823c428d5ff..c611cdc3dc1 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java @@ -263,8 +263,11 @@ public class ContentSearchCluster extends AbstractConfigProducer implements Prot } public void handleRedundancy(Redundancy redundancy) { - if (usesHierarchicDistribution()) { - indexedCluster.setMaxNodesDownPerFixedRow((redundancy.effectiveFinalRedundancy() / groupToSpecMap.size()) - 1); + if (hasIndexedCluster()) { + if (usesHierarchicDistribution()) { + indexedCluster.setMaxNodesDownPerFixedRow((redundancy.effectiveFinalRedundancy() / groupToSpecMap.size()) - 1); + } + indexedCluster.setSearchableCopies(redundancy.searchableCopies()); } this.redundancy = redundancy; } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/Redundancy.java b/config-model/src/main/java/com/yahoo/vespa/model/content/Redundancy.java index 19079f1c551..6d91ae6e540 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/Redundancy.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/Redundancy.java @@ -57,6 +57,7 @@ public class Redundancy implements StorDistributionConfig.Producer, ProtonConfig public boolean isEffectivelyGloballyDistributed() { return totalNodes == effectiveFinalRedundancy(); } + public int searchableCopies() { return readyCopies/(explicitGroups*implicitGroups); } @Override public void getConfig(StorDistributionConfig.Builder builder) { @@ -68,7 +69,7 @@ public class Redundancy implements StorDistributionConfig.Producer, ProtonConfig public void getConfig(ProtonConfig.Builder builder) { ProtonConfig.Distribution.Builder distBuilder = new ProtonConfig.Distribution.Builder(); distBuilder.redundancy(finalRedundancy/explicitGroups); - distBuilder.searchablecopies(readyCopies/(explicitGroups*implicitGroups)); + distBuilder.searchablecopies(searchableCopies()); builder.distribution(distBuilder); } } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/EngineFactoryBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/EngineFactoryBuilder.java index f8961d81bf4..83e9553ebd5 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/EngineFactoryBuilder.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/EngineFactoryBuilder.java @@ -15,7 +15,6 @@ public class EngineFactoryBuilder { throw new IllegalArgumentException("Persistence engine does not allow for indexed search. Please use <proton> as your engine."); } - ModelElement e; if (persistence.getChild("proton") != null) { return new ProtonEngine.Factory(c.getSearch()); } else if (persistence.getChild("dummy") != null) { diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/Dispatch.java b/config-model/src/main/java/com/yahoo/vespa/model/search/Dispatch.java index 87146447dd1..078fdf87c31 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/search/Dispatch.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/search/Dispatch.java @@ -129,6 +129,7 @@ public class Dispatch extends AbstractService implements SearchInterface, int rowbits = dispatchGroup.getRowBits(); final PartitionsConfig.Dataset.Builder datasetBuilder = new PartitionsConfig.Dataset.Builder(). id(0). + searchablecopies(dispatchGroup.getSearchableCopies()). refcost(1). rowbits(rowbits). numparts(dispatchGroup.getNumPartitions()). diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/DispatchGroup.java b/config-model/src/main/java/com/yahoo/vespa/model/search/DispatchGroup.java index 176d55d13d2..3d57732efde 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/search/DispatchGroup.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/search/DispatchGroup.java @@ -72,6 +72,8 @@ public class DispatchGroup { return sc.getMinNodesPerColumn(); } + public int getSearchableCopies() { return sc.getSearchableCopies(); } + public int getMaxNodesDownPerFixedRow() { return sc.getMaxNodesDownPerFixedRow(); } 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 6c478794bfb..6e0aa562508 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 @@ -96,6 +96,8 @@ public class IndexedSearchCluster extends SearchCluster private final UnionConfiguration unionCfg; private int maxNodesDownPerFixedRow = 0; + private int searchableCopies = 1; + private final SimpleConfigProducer dispatchParent; private final DispatchGroup rootDispatch; private DispatchSpec dispatchSpec; @@ -353,7 +355,13 @@ public class IndexedSearchCluster extends SearchCluster public void setMaxNodesDownPerFixedRow(int value) { maxNodesDownPerFixedRow = value; } + public int getSearchableCopies() { + return searchableCopies; + } + public void setSearchableCopies(int searchableCopies) { + this.searchableCopies = searchableCopies; + } public void setDispatchSpec(DispatchSpec dispatchSpec) { if (dispatchSpec.getNumDispatchGroups() != null) { this.dispatchSpec = new DispatchSpec.Builder().setGroups 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 eb62788380f..03ba42e190b 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 @@ -56,6 +56,7 @@ public class ClusterTest { assertEquals(11.0, config.dataset(0).minimal_searchcoverage(), 1E-6); assertEquals(0.23, config.dataset(0).higher_coverage_minsearchwait(), 1E-6); assertEquals(0.58, config.dataset(0).higher_coverage_maxsearchwait(), 1E-6); + assertEquals(2, config.dataset(0).searchablecopies()); } } @@ -82,10 +83,15 @@ public class ClusterTest { " <adminserver hostalias='my_host' />", " </admin>", " <content version='1.0'>", + " <redundancy>3</redundancy>", " <documents>", " " + getDocumentXml(globalDocType), " </documents>", - " <engine><proton /></engine>", + " <engine>", + " <proton>", + " <searchable-copies>2</searchable-copies>", + " </proton>", + " </engine>", " <group>", " <node hostalias='my_host' distribution-key='0' />", " </group>", |