dsmiley commented on code in PR #2916:
URL: https://github.com/apache/solr/pull/2916#discussion_r1894337155
##########
solr/core/src/java/org/apache/solr/handler/admin/ClusterStatus.java:
##########
@@ -216,28 +216,21 @@ private void fetchClusterStatusForCollOrAlias(
MapWriter collectionPropsWriter =
ew -> {
- Iterator<Map<String, Object>> it =
- collectionStream
- .map(
- (collectionState) ->
- collectionPropsResponse(
- collectionState,
- collectionVsAliases,
- routeKey,
- liveNodes,
- requestedShards))
- .iterator();
- while (it.hasNext()) {
- Map<String, Object> props = it.next();
- props.forEach(
- (key, value) -> {
- try {
- ew.put(key, value);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- });
- }
+ collectionStream.forEach(
+ (collectionState) -> {
+ try {
+ ew.put(
+ collectionState.getName(),
+ buildResponseForCollection(
+ collectionState,
+ collectionVsAliases,
+ routeKey,
+ liveNodes,
+ requestedShards));
+ } catch (IOException e) {
+ throw new RuntimeException(e);
Review Comment:
Why does buildResponseForCollection throw IOException? That's suspicious.
If you must, catch in there and throw a suitable exception like SolrException
(which extends RuntimeException and is generally preferred within Solr over RE).
--
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]