From ebfc7be5f5b6383e02c142b7e38bc4cc57b26324 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Fri, 15 Mar 2024 15:54:10 +0100 Subject: Add necessary config to ClusterConfig to avoid hidden relation via clusterId to QrSearchersConfig --- .../search/searchchain/LocalProvider.java | 17 +-------------- .../yahoo/vespa/model/search/SearchCluster.java | 25 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 16 deletions(-) (limited to 'config-model/src/main/java/com/yahoo') 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