murblanc commented on code in PR #2834:
URL: https://github.com/apache/solr/pull/2834#discussion_r1827307530
##########
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:
Performance regression: this forces reading all `state.json` of all
collections.
I think `getCollectionNames()` should be part of this PR and used here
instead.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]