HoustonPutman commented on code in PR #909:
URL: https://github.com/apache/solr/pull/909#discussion_r922290330


##########
solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java:
##########
@@ -525,8 +652,14 @@ private void constructState(Set<String> 
changedCollections) {
     Map<String, ClusterState.CollectionRef> result = new LinkedHashMap<>();
 
     // Add collections
-    for (Map.Entry<String, DocCollection> entry : 
watchedCollectionStates.entrySet()) {
-      result.put(entry.getKey(), new 
ClusterState.CollectionRef(entry.getValue()));
+    for (Entry<String, StatefulCollectionWatch> entry :
+        collectionWatches.watchedCollectionEntries()) {
+      if (entry.getValue().currentState != null) {
+        // if the doc is null for the collection watch, then it should not be 
inserted into the
+        // state
+        result.putIfAbsent(

Review Comment:
   `result` starts out as an empty map, so when you loop through the keys of 
another map and add them to `result`, there can't be duplicates. This could 
honestly just be ` put()`, I think.



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