I want to develop a plugin that needs to use the Settings API to save some state across the cluster, these states are of Set type and Map type, but I can't find the relevant API to set, can anyone help me to see how to do it?
Can you elaborate more on what you are trying to do here?
What do you mean by "Set" and "Map" type exactly.
I want to use the plug-in’s org.elasticsearch.common.settings.Setting API to set and store Java’s java.util.Set and Java.util.Map type objects, but I don’t know how to do it. I found that there are only java.util.List type objects.
The settings API reads from the
elasticsearch.yml file (and/or from dynamic cluster settings).
If is easier if you start with how you want these settings to look in the Yaml, and then work out how to parse them, rather than starting with the settings API.
Provide us with an example of how these new settings would look in
elasticsearch.yml and we can give you some tips on how to parse them.
Maybe I didn't express myself clearly, I want to customize the plugin to store some state data through the settings api, which may be of type Set or Map<String,Vo>, and Vo is my custom value object
The Settings API provides a mechanism to configure your plugin. It isn't the right way to store state for your plugin.
It sounds like you want to store data in cluster state or in a system index.
Cluster state is only suitable if it's a small amount of data and you are very careful about compatibility between versions - a broken cluster state can make your cluster unstable, or potentially unrecoverable.
Is there a better way than the Settings API? Storing data in a specialized index? How do I call the API to do this? Do you have an example?
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.