[
https://issues.apache.org/jira/browse/SOLR-8323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15279195#comment-15279195
]
ASF GitHub Bot commented on SOLR-8323:
--------------------------------------
Github user dragonsinth commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/32#discussion_r62770082
--- Diff:
solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java ---
@@ -485,6 +506,20 @@ private void refreshLegacyClusterState(Watcher watcher)
// Nothing to do, someone else updated same or newer.
return;
}
+ Set<String> liveNodes = this.liveNodes; // volatile read
+ for (Map.Entry<String, CollectionWatch> watchEntry :
this.collectionWatches.entrySet()) {
+ String coll = watchEntry.getKey();
+ CollectionWatch collWatch = watchEntry.getValue();
+ ClusterState.CollectionRef ref =
this.legacyCollectionStates.get(coll);
+ if (ref == null)
+ continue;
--- End diff --
Q: what happens if you try to set a watcher on a collection that doesn't
exist yet? Mostly curious.
> Add CollectionWatcher API to ZkStateReader
> ------------------------------------------
>
> Key: SOLR-8323
> URL: https://issues.apache.org/jira/browse/SOLR-8323
> Project: Solr
> Issue Type: Improvement
> Affects Versions: 6.0
> Reporter: Alan Woodward
> Assignee: Alan Woodward
> Attachments: SOLR-8323.patch, SOLR-8323.patch, SOLR-8323.patch,
> SOLR-8323.patch
>
>
> An API to watch for changes to collection state would be a generally useful
> thing, both internally and for client use.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]