diff options
author | Jon Bratseth <bratseth@vespa.ai> | 2023-06-23 13:31:06 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@vespa.ai> | 2023-06-23 13:31:06 +0200 |
commit | 05557feb18e0e3ae7040235c48a531ef6c5224ae (patch) | |
tree | c3e4471fa56456368227fd127beffa7e0cc6e661 /config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java | |
parent | 19186471396cb886e726f6c35f0031c6fad33b54 (diff) |
Set the recommended searchable copies with streaming
With streaming it is better to make all copies ready.
This does it automatically so we can avoid documenting
that users need to make sure of this by themselves.
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java | 19 |
1 files changed, 19 insertions, 0 deletions
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 ec7acaf819f..34ea41384bc 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 @@ -270,6 +270,25 @@ public class ContentSearchCluster extends TreeConfigProducer<AnyConfigProducer> clusters.put(sc.getClusterName(), sc); } + /** + * Returns whether the schemas in this cluster use streaming mode. + * + * @return True if this cluster only has schemas with streaming mode, False if it only has schemas + * with indexing, null if it has both or none. + */ + public Boolean isStreaming() { + boolean hasStreaming = false; + boolean hasIndexed = false; + for (var cluster : clusters.values()) { + if (cluster.isStreaming()) + hasStreaming = true; + else + hasIndexed = true; + } + if (hasIndexed == hasStreaming) return null; + return hasStreaming; + } + public List<SearchNode> getSearchNodes() { return hasIndexedCluster() ? getIndexed().getSearchNodes() : nonIndexed; } |