aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/vespa/model/search
diff options
context:
space:
mode:
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/search')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/search/IndexedSearchCluster.java4
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/search/SearchCluster.java25
2 files changed, 25 insertions, 4 deletions
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 67d99e300de..c9c7e424ee6 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
@@ -2,12 +2,8 @@
package com.yahoo.vespa.model.search;
import com.yahoo.config.model.api.ModelContext;
-import com.yahoo.config.model.deploy.DeployState;
import com.yahoo.config.model.producer.AnyConfigProducer;
import com.yahoo.config.model.producer.TreeConfigProducer;
-import com.yahoo.schema.DocumentOnlySchema;
-import com.yahoo.schema.derived.DerivedConfiguration;
-import com.yahoo.schema.derived.SchemaInfo;
import com.yahoo.vespa.config.search.DispatchConfig;
import com.yahoo.vespa.config.search.DispatchConfig.DistributionPolicy;
import com.yahoo.vespa.config.search.DispatchNodesConfig;
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/SearchCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/search/SearchCluster.java
index 9d459259253..8a60930664e 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/search/SearchCluster.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/search/SearchCluster.java
@@ -7,6 +7,7 @@ import com.yahoo.container.QrSearchersConfig;
import com.yahoo.schema.DocumentOnlySchema;
import com.yahoo.schema.derived.AttributeFields;
import com.yahoo.schema.derived.DerivedConfiguration;
+import com.yahoo.search.config.ClusterConfig;
import com.yahoo.search.config.SchemaInfoConfig;
import com.yahoo.schema.derived.SchemaInfo;
import com.yahoo.vespa.config.search.AttributesConfig;
@@ -217,6 +218,30 @@ public abstract class SearchCluster extends TreeConfigProducer<AnyConfigProducer
new Join(documentDbs.values()).getConfig(builder);
}
+ public void getConfig(ClusterConfig.Builder builder) {
+ builder.clusterId(getClusterIndex());
+ builder.clusterName(getClusterName());
+ builder.storageRoute(getClusterName());
+ builder.configid(getConfigId());
+ if (visibilityDelay != null) {
+ builder.cacheTimeout(convertVisibilityDelay(visibilityDelay));
+ }
+ if (hasStreaming()) {
+ builder.indexMode(ClusterConfig.IndexMode.Enum.STREAMING);
+ } else {
+ builder.indexMode(ClusterConfig.IndexMode.Enum.INDEX);
+ }
+ }
+
+ // The semantics of visibility delay in search is deactivating caches if the
+ // delay is less than 1.0, in qrs the cache is deactivated if the delay is 0
+ // (or less). 1.0 seems a little arbitrary, so just doing the conversion
+ // here instead of having two totally independent implementations having to
+ // follow each other down in the modules.
+ private static Double convertVisibilityDelay(Double visibilityDelay) {
+ return (visibilityDelay < 1.0d) ? 0.0d : visibilityDelay;
+ }
+
@Override
public String toString() { return "search-capable cluster '" + clusterName + "'"; }