summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-07-01 13:03:07 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-07-01 13:03:07 +0000
commitda3a94ba052bbef730207cb1ceeb73930312b0c3 (patch)
tree64a7056ca37cc386586d3c9c8aa68a86d81adc90 /config-model
parentb6bc5ce6319b1fe73c181bcf2b25a28a64bb9701 (diff)
Add flag for rolling out feed sequencer change.
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java7
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java12
2 files changed, 15 insertions, 4 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 2232e57a06f..181c4ec100a 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
@@ -43,6 +43,7 @@ public class TestProperties implements ModelContext.Properties {
private double threadPoolSizeFactor = 0.0;
private double queueSizeFactor = 0.0;
private String jvmGCOptions = null;
+ private String sequencerType = "LATENCY";
private Optional<EndpointCertificateSecrets> endpointCertificateSecrets = Optional.empty();
private AthenzDomain athenzDomain;
private ApplicationRoles applicationRoles;
@@ -57,7 +58,7 @@ public class TestProperties implements ModelContext.Properties {
@Override public Zone zone() { return zone; }
@Override public Set<ContainerEndpoint> endpoints() { return endpoints; }
@Override public String jvmGCOptions() { return jvmGCOptions; }
-
+ @Override public String feedSequencerType() { return sequencerType; }
@Override public boolean isBootstrap() { return false; }
@Override public boolean isFirstTimeDeployment() { return false; }
@Override public boolean useDedicatedNodeForLogserver() { return useDedicatedNodeForLogserver; }
@@ -78,6 +79,10 @@ public class TestProperties implements ModelContext.Properties {
jvmGCOptions = gcOptions;
return this;
}
+ public TestProperties setFeedSequencerType(String type) {
+ sequencerType = type;
+ return this;
+ }
public TestProperties setDefaultTermwiseLimit(double limit) {
defaultTermwiseLimit = limit;
return this;
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 6cb45c4559b..de91690cae6 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
@@ -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.content;
+import com.yahoo.config.model.api.ModelContext;
import com.yahoo.config.model.deploy.DeployState;
import com.yahoo.vespa.config.search.DispatchConfig;
import com.yahoo.vespa.config.search.core.ProtonConfig;
@@ -43,7 +44,7 @@ public class ContentSearchCluster extends AbstractConfigProducer implements Prot
private final boolean flushOnShutdown;
/** If this is set up for streaming search, it is modelled as one search cluster per search definition */
- private Map<String, AbstractSearchCluster> clusters = new TreeMap<>();
+ private final Map<String, AbstractSearchCluster> clusters = new TreeMap<>();
/** The single, indexed search cluster this sets up (supporting multiple document types), or null if none */
private IndexedSearchCluster indexedCluster;
@@ -55,10 +56,11 @@ public class ContentSearchCluster extends AbstractConfigProducer implements Prot
private Double visibilityDelay = 0.0;
/** The search nodes of this if it does not have an indexed cluster */
- private List<SearchNode> nonIndexed = new ArrayList<>();
+ private final List<SearchNode> nonIndexed = new ArrayList<>();
- private Map<StorageGroup, NodeSpec> groupToSpecMap = new LinkedHashMap<>();
+ private final Map<StorageGroup, NodeSpec> groupToSpecMap = new LinkedHashMap<>();
private Optional<ResourceLimits> resourceLimits = Optional.empty();
+ private final ProtonConfig.Indexing.Optimize.Enum feedSequencerType;
/** Whether the nodes of this cluster also hosts a container cluster in a hosted system */
private final boolean combined;
@@ -89,6 +91,7 @@ public class ContentSearchCluster extends AbstractConfigProducer implements Prot
ContentSearchCluster search = new ContentSearchCluster(ancestor,
clusterName,
+ deployState.getProperties(),
documentDefinitions,
globallyDistributedDocuments,
getFlushOnShutdown(flushOnShutdownElem, deployState),
@@ -176,6 +179,7 @@ public class ContentSearchCluster extends AbstractConfigProducer implements Prot
private ContentSearchCluster(AbstractConfigProducer parent,
String clusterName,
+ ModelContext.Properties featureFlags,
Map<String, NewDocumentType> documentDefinitions,
Set<NewDocumentType> globallyDistributedDocuments,
boolean flushOnShutdown,
@@ -187,6 +191,7 @@ public class ContentSearchCluster extends AbstractConfigProducer implements Prot
this.globallyDistributedDocuments = globallyDistributedDocuments;
this.flushOnShutdown = flushOnShutdown;
this.combined = combined;
+ this.feedSequencerType = ProtonConfig.Indexing.Optimize.Enum.valueOf(featureFlags.feedSequencerType());
}
public void setVisibilityDelay(double delay) {
@@ -379,6 +384,7 @@ public class ContentSearchCluster extends AbstractConfigProducer implements Prot
if (hasAnyNonIndexedCluster) {
builder.feeding.concurrency(builder.feeding.build().concurrency() * 2);
}
+ builder.indexing.optimize(feedSequencerType);
}
private boolean isGloballyDistributed(NewDocumentType docType) {