Any way to access transient cluster settings / state in an ElasticSearch plugin? -


i'd store simple state (key-value pairs) that's shared across elasticsearch cluster, plugin. (n.b. -- plugin not vehicle/method store state, want use such state in plugin.) i've tried doing via cluster update settings api,

settings newsettings = immutablesettings.settingsbuilder()     .put(my_setting, my_value).build(); client.admin().cluster().prepareupdatesettings()     .settransientsettings(newsettings).execute().actionget(); 

but, unfortunately, won't work because my_setting not registered in indexdynamicsettingsmodule. can't figure out how hook module (possibly adddynamicsetting method). is there way store custom key-values in transient cluster settings? (c.f. http api).

as alternatives, seems node state api can return custom values, more things 1 compute , return plugin, rather stored state. storing values in static variables, , distributing throughout cluster broadcast actions option, i'd prefer simple if exists.

any solution needs reasonably robust elasticsearch version upgrades.

thanks in advance!

the way dynamic settings registered changed in 0.90. so, there no solution compatible both 0.20.x , 0.90.x versions @ same time. 0.90.x version can register dynamic settings using adddynamicsettings method:

public class myplugin extends abstractplugin {      /* ... */      public void onmodule(indexdynamicsettingsmodule indexdynamicsettingsmodule) {         indexdynamicsettingsmodule.adddynamicsettings("index.my.setting");     } } 

as alternatives, can add data state implementing , registering own custom data factory. can update cluster state on master , listen cluster state changes in plugin on nodes.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -