mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-05 20:48:22 +00:00
2bf84593e0
The Plugin interface currently contains 6 different methods for adding modules. Elasticsearch has 3 different levels of injectors, and for each of those, there are two methods. The first takes no arguments and returns a collection of class objects to construct. The second takes a Settings object and returns a collection of module objects already constructed. The settings argument is unecessary because the plugin can already get the settings from its constructor. Removing that, the only difference between the two versions is returning an already constructed Module, or a module Class, and there is no reason the plugin can't construct all their modules themselves. This change reduces the plugin api down to just 3 methods for adding modules. Each returns a Collection<Module>. It also removes the processModule method, which was unnecessary since onModule implementations fullfill the same requirement. And finally, it renames the modules() method to nodeModules() so it is clear these are created once for each node.