dawidwys commented on a change in pull request #9937: [FLINK-14416][table] Add
Module interface and ModuleManager
URL: https://github.com/apache/flink/pull/9937#discussion_r338449473
##########
File path:
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/TableEnvironment.java
##########
@@ -103,6 +106,23 @@ static TableEnvironment create(EnvironmentSettings
settings) {
*/
Optional<Catalog> getCatalog(String catalogName);
+ /**
+ * Loads a {@link Module} under a unique name. Modules will be kept in
the loaded order.
+ *
+ * @param moduleName name of the {@link Module}
+ * @param module the module instance
+ * @throws ModuleAlreadyExistException thrown when there is already a
module with the same name
+ */
+ void loadModule(String moduleName, Module module) throws
ModuleAlreadyExistException;
Review comment:
Please do not introduce new exceptions in the API. Especially as it goes
against agreed changes in the FLIP.
The signature that was agreed and voted upon looks like this:
```
void loadModule(String name, Module m);
```
Introducing a checked exception IMHO is not advantageous here. I don't see a
reasonable way a user can react to the exception. If you really want to
introduce an exception for that it should be at least an unchecked exception.
Moreover so far, in all of the API, the convention is that we are using a
single `ValidationException` for a user error and a `TableException` for a
system error. If you really want to introduce a new exception it should at
least extend from the `ValidationException`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services