dsmiley commented on code in PR #4760: URL: https://github.com/apache/solr/pull/4760#discussion_r3826764491
########## changelog/unreleased/SOLR-18382-remove-doccollection-getreplicas.yml: ########## @@ -0,0 +1,8 @@ +# See https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc +title: Remove the deprecated DocCollection.getReplicas() method, which allocated a new list on every call. DocCollection is Iterable<Slice>, so iterate its slices and call Slice.getReplicas(), or use getSlices().stream().flatMap(slice -> slice.getReplicas().stream()). Review Comment: Let's be brief on internal matters where even a changelog is debatable. ```suggestion title: Remove DocCollection.getReplicas() and add similar replicaStream() ``` As I read this... gosh, we're wasting time with such a changelog. That's the thing -- ask yourself, will a user of Solr care? Honestly, no. ########## solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionTooManyReplicasTest.java: ########## @@ -259,9 +255,6 @@ public void testDownedShards() throws Exception { private List<String> getAllNodeNames(String collectionName) { DocCollection state = getCollectionState(collectionName); - return state.getReplicas().stream() - .map(Replica::getNodeName) - .distinct() - .collect(Collectors.toList()); + return state.replicaStream().map(Replica::getNodeName).distinct().collect(Collectors.toList()); Review Comment: ```suggestion return state.replicaStream().map(Replica::getNodeName).distinct().toList(); ``` -- 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]
