I am writing a plugin and would like to configure it through the cluster settings API.
I have overwritten getSettings, and so far so good. I can also update my dynamic settings through the cluster settings API.
However, the change never gets propagated to the plugin. I imagine that the plugin, or the setting, would have to register a listener to react to the update.
Plugin#getComponents receives a ClusterService, and ClusterService#getClusterSettings yields a ClusterSettings, which has methods such as initializeAndWatch and addSettingsUpdateConsumer which allow you to register a listener for changes to particular cluster settings.
works. When I PUT host:9200/_cluster/settings my update method is called.
(I'm getting some additional update events with unexpected setting values and I haven't figured out where they come from, but that must be a different problem.)
getSettings would return some non-dynamic settings. Apparently, that seems to irritate the update logic. The spurious update events disappeared when I restricted the list of settings passed into addSettingsUpdateConsumer to only dynamic settings.
When I have time, I'll look at this some more, perhaps I'm mistaken. But my problem is solved. Thanks again.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.