Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] modularize x-pack plugins ml and autoscaling #95057

Merged
merged 10 commits into from
Apr 6, 2023

Conversation

edsavage
Copy link
Contributor

@edsavage edsavage commented Apr 5, 2023

Add module-info.java files for x-pack plugins ml and autoscaling.

A slight restructure was needed to place the exact.properties resource file into a path name corresponding to a package name. The utils package was chosen as the resource file is required by the DomainSplitFunction class residing there.

Add module-info.java files for x-pack plugins ml and autoscaling
@edsavage edsavage added :ml Machine learning modularization Java Modules related labels Apr 5, 2023
@elasticsearchmachine elasticsearchmachine added v8.8.0 Team:ML Meta label for the ML team labels Apr 5, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

Comment on lines 1 to 7
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the wrong license header - it mentions SSPL which is not an alternative for X-Pack files.

It should be the same license header as the other file in this PR.

@elasticsearchmachine
Copy link
Collaborator

Hi @edsavage, I've created a changelog YAML for you.

@@ -16,6 +16,10 @@
public class MlAutoscalingExtension implements AutoscalingExtension {
private final MachineLearning plugin;

public MlAutoscalingExtension() {
this.plugin = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do it like this:

throw new IllegalStateException("Provider must be constructed using PluginsService");

Otherwise, if anyone did ever call this constructor they'd be setting up a subsequent null pointer exception.

Copy link
Contributor

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@edsavage edsavage merged commit 1edc397 into elastic:main Apr 6, 2023
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Apr 10, 2023
In elastic#95057 we turned ML into a proper module, but omitted a `requires`
directive that IntelliJ reports as a compilation error. This commit adds
the missing directive.
DaveCTurner added a commit that referenced this pull request Apr 11, 2023
In #95057 we turned ML into a proper module, but omitted a `requires`
directive that IntelliJ reports as a compilation error. This commit adds
the missing directive.
@edsavage edsavage deleted the modularize_xpack_plugin_ml branch November 6, 2023 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:ml Machine learning modularization Java Modules related >non-issue Team:ML Meta label for the ML team v8.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants