dsmiley commented on code in PR #2846:
URL: https://github.com/apache/solr/pull/2846#discussion_r1830305417


##########
solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java:
##########
@@ -411,28 +417,19 @@ public Set<String> getHostAllowList() {
   }
 
   /**
-   * Iterate over collections. Unlike {@link #getCollectionStates()} 
collections passed to the
-   * consumer are guaranteed to exist.
-   *
-   * @param consumer collection consumer.
+   * Streams the resolved {@link DocCollection}s, which will often fetch from 
ZooKeeper for each one
+   * for a many-collection scenario. Use this sparingly; some users have 
thousands of collections!
+   */
+  public Stream<DocCollection> collectionStream() {
+    return 
collectionStates.values().stream().map(CollectionRef::get).filter(Objects::nonNull);
+  }
+
+  /**
+   * Calls {@code consumer} with a resolved {@link DocCollection}s for all 
collections. Use this
+   * sparingly in case there are many collections.
    */
   public void forEachCollection(Consumer<DocCollection> consumer) {

Review Comment:
   I agree 100% to remove this as well; I forgot to raise this point and I held 
myself back from scope creep in doing so in this PR.  I'll do a fast followup 
for that little change; same JIRA issue.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to