summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2024-03-15 15:54:10 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2024-03-16 23:10:33 +0000
commitebfc7be5f5b6383e02c142b7e38bc4cc57b26324 (patch)
tree3a223b1a9e7c58c2a1d56d83f7334d463ae78058 /config-model
parentb7d75ef658fbe4a5157e667b09392f1e474945fe (diff)
Add necessary config to ClusterConfig to avoid hidden relation via clusterId to QrSearchersConfig
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/LocalProvider.java17
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/search/SearchCluster.java25
2 files changed, 26 insertions, 16 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/LocalProvider.java b/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/LocalProvider.java
index da7dfdc7b84..554dacb39e3 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/LocalProvider.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/LocalProvider.java
@@ -17,7 +17,6 @@ import com.yahoo.vespa.model.search.SearchCluster;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
-import java.util.Objects;
import java.util.Set;
/**
@@ -38,12 +37,7 @@ public class LocalProvider extends Provider implements
@Override
public void getConfig(ClusterConfig.Builder builder) {
- Objects.requireNonNull(searchCluster, "Null search cluster!");
- builder.clusterId(searchCluster.getClusterIndex());
- builder.clusterName(searchCluster.getClusterName());
-
- if (searchCluster.getVisibilityDelay() != null)
- builder.cacheTimeout(convertVisibilityDelay(searchCluster.getVisibilityDelay()));
+ searchCluster.getConfig(builder);
}
@Override
@@ -131,13 +125,4 @@ public class LocalProvider extends Provider implements
searchCluster.getConfig(builder);
}
- // 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;
- }
-
}
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 + "'"; }