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