Adds a new constructor to plugin

The new constructor takes an Environment object. This is needed for migration to X-Pack since the environment instance is built by the XPackPlugin and then passed into the feature plugins.

Original commit: elastic/x-pack-elasticsearch@f25225bc6a
This commit is contained in:
Colin Goodheart-Smithe 2017-01-25 18:45:04 +00:00
parent 4b366f8ef6
commit 716f543f7b
1 changed files with 5 additions and 1 deletions

View File

@ -141,9 +141,13 @@ public class MlPlugin extends Plugin implements ActionPlugin {
private boolean enabled; private boolean enabled;
public MlPlugin(Settings settings) { public MlPlugin(Settings settings) {
this(settings, new Environment(settings));
}
public MlPlugin(Settings settings, Environment env) {
this.enabled = ML_ENABLED.get(settings); this.enabled = ML_ENABLED.get(settings);
this.settings = settings; this.settings = settings;
this.env = new Environment(settings); this.env = env;
} }
@Override @Override