dsmiley commented on code in PR #2645: URL: https://github.com/apache/solr/pull/2645#discussion_r1724951708
########## solr/core/src/java/org/apache/solr/handler/admin/ColStatus.java: ########## @@ -176,48 +182,50 @@ public void getColStatus(NamedList<Object> results) { if (url == null) { continue; } - try (SolrClient client = solrClientCache.getHttpSolrClient(url)) { - ModifiableSolrParams params = new ModifiableSolrParams(); - params.add(CommonParams.QT, "/admin/segments"); - params.add(FIELD_INFO_PROP, "true"); - params.add(CORE_INFO_PROP, String.valueOf(withCoreInfo)); - params.add(SIZE_INFO_PROP, String.valueOf(withSizeInfo)); - params.add(RAW_SIZE_PROP, String.valueOf(withRawSizeInfo)); - params.add(RAW_SIZE_SUMMARY_PROP, String.valueOf(withRawSizeSummary)); - params.add(RAW_SIZE_DETAILS_PROP, String.valueOf(withRawSizeDetails)); - if (samplingPercent != null) { - params.add(RAW_SIZE_SAMPLING_PERCENT_PROP, String.valueOf(samplingPercent)); - } - QueryRequest req = new QueryRequest(params); - NamedList<Object> rsp = client.request(req); - rsp.remove("responseHeader"); - leaderMap.add("segInfos", rsp); - NamedList<?> segs = (NamedList<?>) rsp.get("segments"); - if (segs != null) { - for (Map.Entry<String, ?> entry : segs) { - NamedList<Object> fields = - (NamedList<Object>) ((NamedList<Object>) entry.getValue()).get("fields"); - if (fields != null) { - for (Map.Entry<String, Object> fEntry : fields) { - Object nc = ((NamedList<Object>) fEntry.getValue()).get("nonCompliant"); - if (nc != null) { - nonCompliant.add(fEntry.getKey()); + if (getSegments) { + try (SolrClient client = solrClientCache.getHttpSolrClient(url)) { + ModifiableSolrParams params = new ModifiableSolrParams(); + params.add(CommonParams.QT, "/admin/segments"); + params.add(FIELD_INFO_PROP, "true"); Review Comment: Okay @mariemat ; I'll leave this be, despite it looking wrong. @sigram you wrote it this way so if you can offer any input, now's a good time. I looked at SOLR-13292 saw no review on this topic either. -- 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: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org