-
Notifications
You must be signed in to change notification settings - Fork 89
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
[FLINK-22915][FLIP-173] Updates the static load(...) method of Stage subclasses to take StreamExecutionEnvironment as parameter #33
Conversation
@gaoyunhaii Could you review this PR? |
82eee62
to
8b05243
Compare
@@ -39,6 +39,7 @@ | |||
void save(String path) throws IOException; | |||
|
|||
// NOTE: every Stage subclass should implement a static method with signature "static T | |||
// load(String path)", where T refers to the concrete subclass. This static method should | |||
// instantiate a new stage instance based on the data from the given path. | |||
// load(StreamExecutionEnvironment env, String path)", where T refers to the concrete |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might move this part of comment to the class comments? Then it would also appear in the java doc.
Also change static T load(StreamExecutionEnvironment env, String path)
-> {@code static T load(StreamExecutionEnvironment env, String path)}
and T
-> {@code T}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. The PR has been updated as suggested.
…subclasses to take StreamExecutionEnvironment as parameter
…e Model instance itself
8b05243
to
e2a1a7f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very thanks @lindong28 for the update! LGTM and +1 to merge
Thanks for the prompt review @gaoyunhaii! |
What is the purpose of the change
This PR updates the static load(...) method of Stage subclasses to take StreamExecutionEnvironment as parameter. This is because the static load method will need to create DataStream or Table instances to read model data.
This PR also updates Model::setModelData(...) to return the Model instance itself. This could improve usability by allowing users to do e.g.
return new KMeansModel().setModelData(...)
.Brief change log
This PR mades the following changes:
Stage
subclasses to take StreamExecutionEnvironment as parameter.ReadWriteUtils
to take StreamExecutionEnvironment as parameter.Verifying this change
The changes are validated by the existing unit tests.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (no)Documentation