murblanc commented on code in PR #2834:
URL: https://github.com/apache/solr/pull/2834#discussion_r1827926712


##########
solr/core/src/java/org/apache/solr/handler/designer/SchemaDesignerConfigSetHelper.java:
##########
@@ -168,24 +167,12 @@ Map<String, Object> analyzeField(String configSet, String 
fieldName, String fiel
   }
 
   List<String> listCollectionsForConfig(String configSet) {
-    final List<String> collections = new ArrayList<>();
-    Map<String, ClusterState.CollectionRef> states =
-        zkStateReader().getClusterState().getCollectionStates();
-    for (Map.Entry<String, ClusterState.CollectionRef> e : states.entrySet()) {
-      final String coll = e.getKey();
-      if (coll.startsWith(DESIGNER_PREFIX)) {
-        continue; // ignore temp
-      }
-
-      try {
-        if (configSet.equals(e.getValue().get().getConfigName()) && 
e.getValue().get() != null) {
-          collections.add(coll);
-        }
-      } catch (Exception exc) {
-        log.warn("Failed to get config name for {}", coll, exc);
-      }
-    }
-    return collections;
+    return zkStateReader()
+        .getClusterState()
+        .collectionStream()

Review Comment:
   My comment is unrelated to the name filter.
   This code collects collection names. The change forces it to read the 
`state.json` of the collections even though it doesn't need the additional 
info. The behavior also changes, partially created collections will no longer 
be considered when previously they were.
   
   I don't know what this specific class does with the collection name, but 
since this PR deprecates a method without providing an alternate way of 
achieving the same result (with comparable performance), I stand by my comment 
to add `getCollectionNames()` in this PR.



-- 
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