You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2021/09/02 10:46:54 UTC

[GitHub] [dolphinscheduler] Narcasserun opened a new pull request #6093: [Feature-6071][common|dao|datasource-plugin] implement the dynamic loading of data source plug-ins (#6071)

Narcasserun opened a new pull request #6093:
URL: https://github.com/apache/dolphinscheduler/pull/6093


   - The data source plug-in loads dynamically through the URL
   - Unified data source connection management
   - add datasource plug-in client
   - add data source plug-in package
   


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [dolphinscheduler] CalvinKirs commented on a change in pull request #6093: [Feature-6071][common|dao|datasource-plugin] implement the dynamic loading of data source plug-ins (#6071)

Posted by GitBox <gi...@apache.org>.
CalvinKirs commented on a change in pull request #6093:
URL: https://github.com/apache/dolphinscheduler/pull/6093#discussion_r702276095



##########
File path: dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-postgresql/pom.xml
##########
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>dolphinscheduler-datasource-plugin</artifactId>
+        <groupId>org.apache.dolphinscheduler</groupId>
+        <version>1.3.6-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>dolphinscheduler-datasource-postgresql</artifactId>
+    <name>${project.artifactId}</name>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.apache.dolphinscheduler</groupId>
+            <artifactId>dolphinscheduler-dao</artifactId>
+            <scope>provided</scope>
+        </dependency>

Review comment:
       Plugins should remain independent and not depend on the kernel module




-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [dolphinscheduler] CalvinKirs commented on a change in pull request #6093: [Feature-6071][common|dao|datasource-plugin] implement the dynamic loading of data source plug-ins (#6071)

Posted by GitBox <gi...@apache.org>.
CalvinKirs commented on a change in pull request #6093:
URL: https://github.com/apache/dolphinscheduler/pull/6093#discussion_r702275996



##########
File path: dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-postgresql/pom.xml
##########
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>dolphinscheduler-datasource-plugin</artifactId>
+        <groupId>org.apache.dolphinscheduler</groupId>
+        <version>1.3.6-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>dolphinscheduler-datasource-postgresql</artifactId>
+    <name>${project.artifactId}</name>
+

Review comment:
       The plugin packaging method needs to be changed to <packaging>dolphinscheduler-plugin</packaging>




-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [dolphinscheduler] Narcasserun commented on a change in pull request #6093: [Feature-6071][common|dao|datasource-plugin] implement the dynamic loading of data source plug-ins (#6071)

Posted by GitBox <gi...@apache.org>.
Narcasserun commented on a change in pull request #6093:
URL: https://github.com/apache/dolphinscheduler/pull/6093#discussion_r702434853



##########
File path: dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-postgresql/pom.xml
##########
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>dolphinscheduler-datasource-plugin</artifactId>
+        <groupId>org.apache.dolphinscheduler</groupId>
+        <version>1.3.6-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>dolphinscheduler-datasource-postgresql</artifactId>
+    <name>${project.artifactId}</name>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.apache.dolphinscheduler</groupId>
+            <artifactId>dolphinscheduler-dao</artifactId>
+            <scope>provided</scope>
+        </dependency>

Review comment:
       Basically, those who rely on datasource plugin will rely on Dao. At present, there is no major problem in terms of reusability and scalability. If there are more complex scenarios in the future, they can be split

##########
File path: dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/provider/DataSourceClientProvider.java
##########
@@ -0,0 +1,173 @@
+/*
+ * 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.dolphinscheduler.dao.provider;
+
+import static org.apache.dolphinscheduler.common.enums.DbType.HIVE;
+
+import org.apache.dolphinscheduler.common.datasource.BaseConnectionParam;
+import org.apache.dolphinscheduler.common.enums.DbType;
+import org.apache.dolphinscheduler.common.exception.BaseException;
+import org.apache.dolphinscheduler.common.utils.ClassLoaderUtils;
+import org.apache.dolphinscheduler.common.utils.ReflectionUtils;
+import org.apache.dolphinscheduler.common.utils.StringUtils;
+import org.apache.dolphinscheduler.dao.datasource.DataSourceClient;
+import org.apache.dolphinscheduler.dao.datasource.JdbcDriverManager;
+
+import java.io.FilenameFilter;
+import java.net.MalformedURLException;
+import java.sql.Driver;
+import java.util.HashSet;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.collect.Sets;
+
+/**
+ * DataSource Plug in dynamic loading
+ */
+public class DataSourceClientProvider {
+
+    private static final Logger logger = LoggerFactory.getLogger(DataSourceClientProvider.class);
+
+    private static final JdbcDriverManager jdbcDriverManagerInstance = JdbcDriverManager.getInstance();
+
+    public static DataSourceClient createDataSourceClient(BaseConnectionParam baseConnectionParam, DbType dbType) {
+        logger.info("Creating the createDataSourceClient. JdbcUrl: {} ", baseConnectionParam.getJdbcUrl());
+        //Check jdbc driver location
+        checkDriverLocation(baseConnectionParam, dbType);

Review comment:
       Thank you for your suggestion. I will try to use the SPI module's plug-in loading method uniformly




-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [dolphinscheduler] Narcasserun commented on a change in pull request #6093: [Feature-6071][common|dao|datasource-plugin] implement the dynamic loading of data source plug-ins (#6071)

Posted by GitBox <gi...@apache.org>.
Narcasserun commented on a change in pull request #6093:
URL: https://github.com/apache/dolphinscheduler/pull/6093#discussion_r702432426



##########
File path: dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-postgresql/pom.xml
##########
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>dolphinscheduler-datasource-plugin</artifactId>
+        <groupId>org.apache.dolphinscheduler</groupId>
+        <version>1.3.6-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>dolphinscheduler-datasource-postgresql</artifactId>
+    <name>${project.artifactId}</name>
+

Review comment:
       Yes, I'll modify it




-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [dolphinscheduler] CalvinKirs commented on a change in pull request #6093: [Feature-6071][common|dao|datasource-plugin] implement the dynamic loading of data source plug-ins (#6071)

Posted by GitBox <gi...@apache.org>.
CalvinKirs commented on a change in pull request #6093:
URL: https://github.com/apache/dolphinscheduler/pull/6093#discussion_r702276339



##########
File path: dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/provider/DataSourceClientProvider.java
##########
@@ -0,0 +1,173 @@
+/*
+ * 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.dolphinscheduler.dao.provider;
+
+import static org.apache.dolphinscheduler.common.enums.DbType.HIVE;
+
+import org.apache.dolphinscheduler.common.datasource.BaseConnectionParam;
+import org.apache.dolphinscheduler.common.enums.DbType;
+import org.apache.dolphinscheduler.common.exception.BaseException;
+import org.apache.dolphinscheduler.common.utils.ClassLoaderUtils;
+import org.apache.dolphinscheduler.common.utils.ReflectionUtils;
+import org.apache.dolphinscheduler.common.utils.StringUtils;
+import org.apache.dolphinscheduler.dao.datasource.DataSourceClient;
+import org.apache.dolphinscheduler.dao.datasource.JdbcDriverManager;
+
+import java.io.FilenameFilter;
+import java.net.MalformedURLException;
+import java.sql.Driver;
+import java.util.HashSet;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.collect.Sets;
+
+/**
+ * DataSource Plug in dynamic loading
+ */
+public class DataSourceClientProvider {
+
+    private static final Logger logger = LoggerFactory.getLogger(DataSourceClientProvider.class);
+
+    private static final JdbcDriverManager jdbcDriverManagerInstance = JdbcDriverManager.getInstance();
+
+    public static DataSourceClient createDataSourceClient(BaseConnectionParam baseConnectionParam, DbType dbType) {
+        logger.info("Creating the createDataSourceClient. JdbcUrl: {} ", baseConnectionParam.getJdbcUrl());
+        //Check jdbc driver location
+        checkDriverLocation(baseConnectionParam, dbType);

Review comment:
       It is better to use the spi module's plug-in loading method uniformly




-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [dolphinscheduler] Narcasserun closed pull request #6093: [Feature-6071][common|dao|datasource-plugin] implement the dynamic loading of data source plug-ins (#6071)

Posted by GitBox <gi...@apache.org>.
Narcasserun closed pull request #6093:
URL: https://github.com/apache/dolphinscheduler/pull/6093


   


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org