aparnasuresh85 commented on code in PR #2599:
URL: https://github.com/apache/solr/pull/2599#discussion_r1704648811


##########
solr/core/src/java/org/apache/solr/handler/admin/ClusterStatus.java:
##########
@@ -89,14 +93,61 @@ public static Health combine(Collection<Health> states) {
     }
   }
 
-  public ClusterStatus(ZkStateReader zkStateReader, ZkNodeProps props) {
+  public ClusterStatus(ZkStateReader zkStateReader, SolrParams params) {
     this.zkStateReader = zkStateReader;
-    this.message = props;
-    collection = props.getStr(ZkStateReader.COLLECTION_PROP);
+    this.solrParams = params;
+    collection = params.get(ZkStateReader.COLLECTION_PROP);
   }
 
   public void getClusterStatus(NamedList<Object> results)
       throws KeeperException, InterruptedException {
+    List<String> liveNodes = null;
+    NamedList<Object> clusterStatus = new SimpleOrderedMap<>();
+
+    boolean includeAll = this.solrParams.getBool(INCLUDE_ALL, true);
+    boolean withLiveNodes =
+        this.solrParams.getBool(LIVENODES_PROP, includeAll) || (collection != 
null);

Review Comment:
   Let me know what you think: When cluster status for a collection is fetched, 
there is a check at some point to `crossCheckReplicaStateWithLiveNodes()`. 
`liveNodes` would need to be assigned an empty List in the beginning so 
`crossCheckReplicaStateWithLiveNodes()` does not throw a `NPE`.  
   
   So if `collection!=null` and `liveNodes=false` what would be returned is the 
list of replicas, but no indication of whether it is on a live node and 
therefore usable. 



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