dsmiley commented on code in PR #4760:
URL: https://github.com/apache/solr/pull/4760#discussion_r3822127348
##########
solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java:
##########
@@ -400,13 +401,9 @@ public Iterator<Slice> iterator() {
return slices.values().iterator();
}
- @Deprecated // low usage and builds an ArrayList (surprising)
- public List<Replica> getReplicas() {
- List<Replica> replicas = new ArrayList<>();
- for (Slice slice : this) {
- replicas.addAll(slice.getReplicas());
- }
- return replicas;
+ /** Stream of all replicas across all slices. */
+ public Stream<Replica> getReplicaStream() {
Review Comment:
Since we don't merely get something we have (we don't already have a
Stream), maybe the name of this method should be `replicaStream` ? OTOH,
nobody ought to ever think a Stream returning method is saved/persisted; they
are always ephemeral. Hoping to here from @serhiy-bzhezytskyy and not your AI.
--
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]