summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2024-03-13 23:22:34 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2024-03-14 19:55:00 +0100
commita544670e6f9f9146cc9514d86a440d05d76be28b (patch)
tree142870b150bba9659b3653aae2e20fb04494e794 /config-model/src/main/java/com/yahoo
parent3c1d192192f903b0dffc81b2f3503830a705f0eb (diff)
Avoid dependency of IndexedSearchCluster
Diffstat (limited to 'config-model/src/main/java/com/yahoo')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/StreamingSearchClusterChangeValidator.java12
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/content/Content.java7
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java6
3 files changed, 12 insertions, 13 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/StreamingSearchClusterChangeValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/StreamingSearchClusterChangeValidator.java
index 0d42219dade..39894d95c2c 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/StreamingSearchClusterChangeValidator.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/StreamingSearchClusterChangeValidator.java
@@ -30,13 +30,11 @@ public class StreamingSearchClusterChangeValidator implements ChangeValidator {
context.previousModel().getContentClusters().forEach((clusterName, currentCluster) -> {
ContentCluster nextCluster = context.model().getContentClusters().get(clusterName);
if (nextCluster != null) {
- var nextStreamingClusters = nextCluster.getSearch().getClusters();
- currentCluster.getSearch().getClusters().values().forEach(currentStreamingCluster -> {
- SearchCluster nextStreamingCluster = nextStreamingClusters.get(currentStreamingCluster.getClusterName());
- if (nextStreamingCluster != null) {
- validateStreamingCluster(currentCluster, currentStreamingCluster, nextCluster, nextStreamingCluster).forEach(context::require);
- }
- });
+ if (currentCluster.getSearch().getIndexed() != null && nextCluster.getSearch().getIndexed() != null) {
+ validateStreamingCluster(currentCluster, currentCluster.getSearch().getIndexed(),
+ nextCluster, nextCluster.getSearch().getIndexed())
+ .forEach(context::require);
+ }
}
});
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/Content.java b/config-model/src/main/java/com/yahoo/vespa/model/content/Content.java
index 1254f8e110a..4ac7a8e442a 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/content/Content.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/content/Content.java
@@ -135,8 +135,11 @@ public class Content extends ConfigModel {
public static List<SearchCluster> getSearchClusters(ConfigModelRepo pc) {
List<SearchCluster> clusters = new ArrayList<>();
- for (ContentCluster c : getContentClusters(pc))
- clusters.addAll(c.getSearch().getClusters().values());
+ for (ContentCluster c : getContentClusters(pc)) {
+ if (c.getSearch().hasIndexedCluster()) {
+ clusters.add(c.getSearch().getIndexed());
+ }
+ }
return clusters;
}
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 e2fe660cbe9..469901bb542 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
@@ -229,9 +229,8 @@ public class ContentSearchCluster extends TreeConfigProducer<AnyConfigProducer>
*/
public Boolean isStreaming() {
if (indexedCluster == null) return false;
- boolean hasStreaming = indexedCluster.schemas().values().stream().anyMatch(schema -> schema.getIndexMode() == SchemaInfo.IndexMode.STREAMING);
- boolean hasIndexed = indexedCluster.schemas().values().stream().anyMatch(schema -> schema.getIndexMode() == SchemaInfo.IndexMode.INDEX);
- if (hasIndexed == hasStreaming) return null;
+ boolean hasStreaming = indexedCluster.hasStreaming();
+ if (indexedCluster.hasIndexed() == hasStreaming) return null;
return hasStreaming;
}
@@ -404,7 +403,6 @@ public class ContentSearchCluster extends TreeConfigProducer<AnyConfigProducer>
getIndexed().getConfig(builder);
}
}
- public Map<String, SearchCluster> getClusters() { return clusters; }
public IndexedSearchCluster getIndexed() { return indexedCluster; }
public boolean hasIndexedCluster() { return indexedCluster != null; }
public IndexingDocproc getIndexingDocproc() { return indexingDocproc; }