serhiy-bzhezytskyy commented on PR #4760:
URL: https://github.com/apache/solr/pull/4760#issuecomment-5352078953

   Thanks! Added `getReplicaStream()` and refactored the 44 call sites that 
would benefit -- 36 identical `.getSlices().stream().flatMap(slice -> 
slice.getReplicas().stream())` blocks and 8 `.mapToInt(s -> 
s.getReplicas().size()).sum()` counts collapse to one call each. Left the dozen 
manual for-loops alone since some carry extra logic inline.
   
   25 test classes re-verified, including the two @Nightly ones this touches 
(ShardSplitTest, TestPullReplica) -- 0 failures.
   
   P.S. Three more sites use the same pattern outside this PR's diff -- 
`CollectionHandlingUtils.java` and `CreateCollectionCmd.java` (production code, 
not tests) plus `CreateRoutedAliasTest.java` -- left alone here since they're 
out of scope, but `getReplicaStream()` would help there too.
   
   AI-assisted (Claude Sonnet 5)


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

Reply via email to