Hisoka-X commented on code in PR #176: URL: https://github.com/apache/seatunnel-web/pull/176#discussion_r1712612509
########## seatunnel-datasource/seatunnel-datasource-plugins/datasource-console/src/main/java/org/apache/seatunnel/datasource/plugin/console/ConsoleDataSourceConfig.java: ########## @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.seatunnel.datasource.plugin.console; + +import org.apache.seatunnel.api.configuration.Option; +import org.apache.seatunnel.api.configuration.Options; +import org.apache.seatunnel.api.configuration.util.OptionRule; +import org.apache.seatunnel.datasource.plugin.api.DataSourcePluginInfo; +import org.apache.seatunnel.datasource.plugin.api.DatasourcePluginTypeEnum; + +public class ConsoleDataSourceConfig { + + public static final String PLUGIN_NAME = "Console"; + + public static final DataSourcePluginInfo CONSOLE_DATASOURCE_PLUGIN_INFO = + DataSourcePluginInfo.builder() + .name(PLUGIN_NAME) + .icon(PLUGIN_NAME) + .version("1.0.0") + .type(DatasourcePluginTypeEnum.FAKE_CONNECTION.getCode()) + .build(); + + public static final Option<String> URL = + Options.key("url") + .stringType() + .defaultValue("dummy://URL") + .withDescription( + "This is required to meet the design constraints, however, it won't be utilized during execution."); Review Comment: According to our initial idea, we will split a seatunnel connector options into two parts, one for datasource and one for connector. Finally, when generating the config, we can merge the options of these two parts. For example, for JDBC, we will put jdbc url, username, password in the datasource https://github.com/apache/seatunnel-web/blob/main/seatunnel-datasource/seatunnel-datasource-plugins/datasource-jdbc-mysql/src/main/java/org/apache/seatunnel/datasource/plugin/mysql/jdbc/MysqlDataSourceConfig.java#L44 because they belong to datasource information, and put the others in the connector because different tables may have different query parameters. So when we define an option in the datasource, the option with the same name will not be displayed when creating the connector. This is the logic. https://github.com/apache/seatunnel-web/blob/main/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/thirdparty/datasource/AbstractDataSourceConfigSwitcher.java#L172 -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
