summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-03-06 13:07:42 +0100
committerGitHub <noreply@github.com>2020-03-06 13:07:42 +0100
commit066f9353f483d7e2ee326fe84fd5c2bca6a415e7 (patch)
treec80632d440b5286ee6688e008774e3155df68f1a
parentcb866b015287901b7e11bbc6b4114f6c03f70aca (diff)
parent6f81f4291d5fa0d226737e496e36a0e2b2fc5c9b (diff)
Merge pull request #12477 from vespa-engine/balder/visibility-delay-for-all
Remove the technical reason for allowing visibility only for indexed …
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java11
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java23
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/search/IndexedSearchCluster.java3
3 files changed, 24 insertions, 13 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 75161859068..fa822df652f 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
@@ -52,6 +52,7 @@ public class ContentSearchCluster extends AbstractConfigProducer implements Prot
private final String clusterName;
private final Map<String, NewDocumentType> documentDefinitions;
private final Set<NewDocumentType> globallyDistributedDocuments;
+ private Double visibilityDelay = 0.0;
/** The search nodes of this if it does not have an indexed cluster */
private List<SearchNode> nonIndexed = new ArrayList<>();
@@ -142,7 +143,7 @@ public class ContentSearchCluster extends AbstractConfigProducer implements Prot
Double visibilityDelay = clusterElem.childAsDouble("engine.proton.visibility-delay");
if (visibilityDelay != null) {
- isc.setVisibilityDelay(visibilityDelay);
+ search.setVisibilityDelay(visibilityDelay);
}
search.addSearchCluster(deployState, isc, getQueryTimeout(clusterElem), indexedDefs);
@@ -179,6 +180,13 @@ public class ContentSearchCluster extends AbstractConfigProducer implements Prot
this.flushOnShutdown = flushOnShutdown;
}
+ public void setVisibilityDelay(double delay) {
+ this.visibilityDelay=delay;
+ if (hasIndexedCluster()) {
+ indexedCluster.setVisibilityDelay(delay);
+ }
+ }
+
private void addSearchCluster(DeployState deployState, SearchCluster cluster, Double queryTimeout, List<ModelElement> documentDefs) {
addSearchDefinitions(deployState, documentDefs, cluster);
@@ -307,7 +315,6 @@ public class ContentSearchCluster extends AbstractConfigProducer implements Prot
@Override
public void getConfig(ProtonConfig.Builder builder) {
- double visibilityDelay = hasIndexedCluster() ? getIndexed().getVisibilityDelay() : 0.0;
builder.feeding.concurrency(0.40); // As if specified 0.8 in services.xml
boolean hasAnyNonIndexedCluster = false;
for (NewDocumentType type : TopologicalDocumentTypeSorter.sort(documentDefinitions.values())) {
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java
index 9b17412b83a..066fef727c5 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java
@@ -136,10 +136,7 @@ public class ContentCluster extends AbstractConfigProducer implements
c.rootGroup = new StorageGroup.Builder(contentElement, context).buildRootGroup(deployState, redundancyBuilder, c);
validateThatGroupSiblingsAreUnique(c.clusterName, c.rootGroup);
c.search.handleRedundancy(c.redundancy);
-
- IndexedSearchCluster index = c.search.getIndexed();
- if (index != null)
- setupIndexedCluster(index, contentElement, deployState.getDeployLogger());
+ setupSearchCluster(c.search, contentElement, deployState.getDeployLogger());
if (c.search.hasIndexedCluster() && !(c.persistenceFactory instanceof ProtonEngine.Factory) )
throw new RuntimeException("Indexed search requires proton as engine");
@@ -166,17 +163,25 @@ public class ContentCluster extends AbstractConfigProducer implements
return c;
}
- private void setupIndexedCluster(IndexedSearchCluster index, ModelElement element, DeployLogger logger) {
+ private void setupSearchCluster(ContentSearchCluster csc, ModelElement element, DeployLogger logger) {
ContentSearch search = DomContentSearchBuilder.build(element);
+ Double visibilityDelay = search.getVisibilityDelay();
+ if (visibilityDelay != null) {
+ csc.setVisibilityDelay(visibilityDelay);
+ }
+ if (csc.hasIndexedCluster()) {
+ setupIndexedCluster(csc.getIndexed(), search, element, logger);
+ }
+
+
+ }
+ private void setupIndexedCluster(IndexedSearchCluster index, ContentSearch search, ModelElement element, DeployLogger logger) {
Double queryTimeout = search.getQueryTimeout();
if (queryTimeout != null) {
Preconditions.checkState(index.getQueryTimeout() == null,
- "In " + index + ": You may not specify query-timeout in both proton and content.");
+ "In " + index + ": You may not specify query-timeout in both proton and content.");
index.setQueryTimeout(queryTimeout);
}
- Double visibilityDelay = search.getVisibilityDelay();
- if (visibilityDelay != null)
- index.setVisibilityDelay(visibilityDelay);
index.setSearchCoverage(DomSearchCoverageBuilder.build(element));
index.setDispatchSpec(DomDispatchBuilder.build(element));
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 445c93ba66e..e8e02d8aba1 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
@@ -154,8 +154,7 @@ public class IndexedSearchCluster extends SearchCluster
private void fillDocumentDBConfig(DocumentDatabase sdoc, ProtonConfig.Documentdb.Builder ddbB) {
ddbB.inputdoctypename(sdoc.getInputDocType())
- .configid(sdoc.getConfigId())
- .visibilitydelay(getVisibilityDelay());
+ .configid(sdoc.getConfigId());
}
@Override