mlbiscoc commented on code in PR #2916:
URL: https://github.com/apache/solr/pull/2916#discussion_r1894393177


##########
solr/core/src/java/org/apache/solr/handler/admin/ClusterStatus.java:
##########
@@ -356,28 +346,28 @@ public static Map<String, Object> 
postProcessCollectionJSON(Map<String, Object>
     return collection;
   }
 
-  private Map<String, Object> collectionPropsResponse(
+  private Map<String, Object> buildResponseForCollection(
       DocCollection clusterStateCollection,
       Map<String, List<String>> collectionVsAliases,
       String routeKey,
       List<String> liveNodes,
       Set<String> requestedShards) {
-    Map<String, Object> collectionProps = new HashMap<>();
     Map<String, Object> collectionStatus;
+    Set<String> shards = new HashSet<>(requestedShards);
     String name = clusterStateCollection.getName();
 
     if (routeKey != null) {
       DocRouter router = clusterStateCollection.getRouter();
       Collection<Slice> slices = router.getSearchSlices(routeKey, null, 
clusterStateCollection);
       for (Slice slice : slices) {
-        requestedShards.add(slice.getName());
+        shards.add(slice.getName());
       }

Review Comment:
   We could throw a `SolrException(BAD_REQUEST)` higher up the stack if passed 
both `shard` and `_route_`. I can update the ref-docs to say you can only do 
one or the other. But this could break people who are doing both.
   
   I also changed that logic into a single line and `forEach`



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