[
https://issues.apache.org/jira/browse/SOLR-17535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17899325#comment-17899325
]
ASF subversion and git services commented on SOLR-17535:
--------------------------------------------------------
Commit 70ad3d898e0dfc02cb14b58138ce4a240bdbf950 in solr's branch
refs/heads/branch_9x from David Smiley
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=70ad3d898e0 ]
SOLR-17535: Migrate ClusterState.getCollectionsMap callers to Stream (#2846)
Deprecated getCollectionsMap.
A refactoring, albeit some additional points:
* DeleteCollection: avoid NPE for non-existent collection (trivial change)
* ClusterStateUtil (test-framework): optimize waiting to use
ZkStateReader.waitForState for single-collection
(cherry picked from commit 24fe19177bc0ffe29d4ddcf8857ac83f57e0f58b)
> Remove ClusterState.getCollectionStates() and getCollectionsMap()
> -----------------------------------------------------------------
>
> Key: SOLR-17535
> URL: https://issues.apache.org/jira/browse/SOLR-17535
> Project: Solr
> Issue Type: Improvement
> Security Level: Public(Default Security Level. Issues are Public)
> Components: SolrCloud
> Reporter: David Smiley
> Assignee: David Smiley
> Priority: Major
> Labels: pull-request-available
> Time Spent: 4h 40m
> Remaining Estimate: 0h
>
> To avoid creating intermediary maps for ClusterState consumers, and to limit
> the direct usages of CollectionRef, I propose removing both
> getCollectionStates and getCollectionsMap. This refactoring helps with any
> future evolution of ClusterState. Instead, callers can use forEachCollection
> or a new {{Stream<DocCollection>}} one proposed here.
> {code:java}
> /** Streams the resolved DocCollections. Use this sparingly in case there
> are many collections. */
> public Stream<DocCollection> collectionStream() {
> return
> collectionStates.values().stream().map(CollectionRef::get).filter(Objects::nonNull);
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]