You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by yx...@apache.org on 2022/11/09 09:59:10 UTC

[shardingsphere] branch master updated: Replace pipeline-core dependency to pipeline-api in sharding modules (#22031)

This is an automated email from the ASF dual-hosted git repository.

yx9o pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 7ca33ec7df4 Replace pipeline-core dependency to pipeline-api in sharding modules (#22031)
7ca33ec7df4 is described below

commit 7ca33ec7df4e5f110f1b7acd441b8e7439eb401e
Author: Hongsheng Zhong <zh...@apache.org>
AuthorDate: Wed Nov 9 17:59:04 2022 +0800

    Replace pipeline-core dependency to pipeline-api in sharding modules (#22031)
    
    * Replace pipeline-core dependency to pipeline-api in sharding modules
    
    * Rename SPI configuration file name
---
 docs/document/content/user-manual/error-code/sql-error-code.cn.md   | 4 ++--
 docs/document/content/user-manual/error-code/sql-error-code.en.md   | 2 +-
 features/sharding/core/pom.xml                                      | 2 +-
 features/sharding/distsql/handler/pom.xml                           | 6 ------
 infra/datetime/type/database/pom.xml                                | 6 ++++++
 .../exception/DatetimeConfigurationFileNotFoundException.java       | 4 ++--
 .../datasource/creator/ShardingSpherePipelineDataSourceCreator.java | 2 +-
 ....data.pipeline.spi.datasource.creator.PipelineDataSourceCreator} | 0
 .../pipeline/spi}/datasource/creator/PipelineDataSourceCreator.java | 2 +-
 .../core/datasource/creator/PipelineDataSourceCreatorFactory.java   | 1 +
 .../datasource/creator/impl/StandardPipelineDataSourceCreator.java  | 2 +-
 ....data.pipeline.spi.datasource.creator.PipelineDataSourceCreator} | 0
 .../core/datasource/creator/FixturePipelineDataSourceCreator.java   | 2 ++
 ....data.pipeline.spi.datasource.creator.PipelineDataSourceCreator} | 0
 .../datasource/creator/PipelineDataSourceCreatorFactoryTest.java    | 1 +
 test/rewrite/pom.xml                                                | 5 +++++
 16 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/docs/document/content/user-manual/error-code/sql-error-code.cn.md b/docs/document/content/user-manual/error-code/sql-error-code.cn.md
index 04f97b0e588..1d36f0e4944 100644
--- a/docs/document/content/user-manual/error-code/sql-error-code.cn.md
+++ b/docs/document/content/user-manual/error-code/sql-error-code.cn.md
@@ -28,9 +28,10 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,
 ### 数据
 
 | SQL State | Vendor Code | 错误信息 |
-| --------- | ----------- | ------ |
+| --------- |-------------| ------ |
 | HY004     | 11000       | Invalid value \`%s\`. |
 | HY004     | 11001       | Unsupported conversion data type \`%s\` for value \`%s\`. |
+| HY000     | 11002       | Can not find \`%s\` file for datetime initialize. |
 | HY004     | 11010       | Unsupported conversion stream charset \`%s\`. |
 
 ### 语法
@@ -83,7 +84,6 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,
 | SQL State | Vendor Code | 错误信息 |
 | --------- | ----------- | ------ |
 | HY000     | 17000       | Work ID assigned failed, which can not exceed 1024. |
-| HY000     | 17001       | Can not find \`%s\` file for datetime initialize. |
 | HY000     | 17002       | File access failed, reason is: %s |
 | HY000     | 17010       | Cluster persist repository error, reason is: %s |
 
diff --git a/docs/document/content/user-manual/error-code/sql-error-code.en.md b/docs/document/content/user-manual/error-code/sql-error-code.en.md
index fdda7dafdbb..398f76e770e 100644
--- a/docs/document/content/user-manual/error-code/sql-error-code.en.md
+++ b/docs/document/content/user-manual/error-code/sql-error-code.en.md
@@ -31,6 +31,7 @@ SQL error codes provide by standard `SQL State`, `Vendor Code` and `Reason`, whi
 | --------- | ----------- | ------ |
 | HY004     | 11000       | Invalid value \`%s\`. |
 | HY004     | 11001       | Unsupported conversion data type \`%s\` for value \`%s\`. |
+| HY000     | 11002       | Can not find \`%s\` file for datetime initialize. |
 | HY004     | 11010       | Unsupported conversion stream charset \`%s\`. |
 
 ### Syntax
@@ -83,7 +84,6 @@ SQL error codes provide by standard `SQL State`, `Vendor Code` and `Reason`, whi
 | SQL State | Vendor Code | Reason |
 | --------- | ----------- | ------ |
 | HY000     | 17000       | Work ID assigned failed, which can not exceed 1024. |
-| HY000     | 17001       | Can not find \`%s\` file for datetime initialize. |
 | HY000     | 17002       | File access failed, reason is: %s |
 | HY000     | 17010       | Cluster persist repository error, reason is: %s |
 
diff --git a/features/sharding/core/pom.xml b/features/sharding/core/pom.xml
index 68273cec83f..8257bbcdf69 100644
--- a/features/sharding/core/pom.xml
+++ b/features/sharding/core/pom.xml
@@ -35,7 +35,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.shardingsphere</groupId>
-            <artifactId>shardingsphere-data-pipeline-core</artifactId>
+            <artifactId>shardingsphere-data-pipeline-api</artifactId>
             <version>${project.version}</version>
         </dependency>
         
diff --git a/features/sharding/distsql/handler/pom.xml b/features/sharding/distsql/handler/pom.xml
index 14357af4ef9..ed48da4ea6d 100644
--- a/features/sharding/distsql/handler/pom.xml
+++ b/features/sharding/distsql/handler/pom.xml
@@ -43,12 +43,6 @@
             <artifactId>shardingsphere-sharding-distsql-parser</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <!-- TODO now depend on pipeline spi later -->
-        <dependency>
-            <groupId>org.apache.shardingsphere</groupId>
-            <artifactId>shardingsphere-data-pipeline-core</artifactId>
-            <version>${project.version}</version>
-        </dependency>
         
         <dependency>
             <groupId>org.apache.shardingsphere</groupId>
diff --git a/infra/datetime/type/database/pom.xml b/infra/datetime/type/database/pom.xml
index 7abb2a6f790..c7bf65889a8 100644
--- a/infra/datetime/type/database/pom.xml
+++ b/infra/datetime/type/database/pom.xml
@@ -32,6 +32,7 @@
             <artifactId>shardingsphere-infra-datetime-spi</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <!-- TODO seems it's not necessary -->
         <dependency>
             <groupId>org.apache.shardingsphere</groupId>
             <artifactId>shardingsphere-sharding-core</artifactId>
@@ -49,5 +50,10 @@
             <groupId>com.h2database</groupId>
             <artifactId>h2</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.zaxxer</groupId>
+            <artifactId>HikariCP</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 </project>
diff --git a/infra/datetime/type/database/src/main/java/org/apache/shardingsphere/datetime/database/exception/DatetimeConfigurationFileNotFoundException.java b/infra/datetime/type/database/src/main/java/org/apache/shardingsphere/datetime/database/exception/DatetimeConfigurationFileNotFoundException.java
index a3f8a49b08b..a1db4268752 100644
--- a/infra/datetime/type/database/src/main/java/org/apache/shardingsphere/datetime/database/exception/DatetimeConfigurationFileNotFoundException.java
+++ b/infra/datetime/type/database/src/main/java/org/apache/shardingsphere/datetime/database/exception/DatetimeConfigurationFileNotFoundException.java
@@ -17,13 +17,13 @@
 
 package org.apache.shardingsphere.datetime.database.exception;
 
+import org.apache.shardingsphere.infra.exception.DataSQLException;
 import org.apache.shardingsphere.infra.util.exception.external.sql.sqlstate.XOpenSQLState;
-import org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.workerid.exception.ClusterSQLException;
 
 /**
  * Datetime configuration file not found exception.
  */
-public final class DatetimeConfigurationFileNotFoundException extends ClusterSQLException {
+public final class DatetimeConfigurationFileNotFoundException extends DataSQLException {
     
     private static final long serialVersionUID = 4820838154441059833L;
     
diff --git a/jdbc/core/src/main/java/org/apache/shardingsphere/driver/data/pipeline/datasource/creator/ShardingSpherePipelineDataSourceCreator.java b/jdbc/core/src/main/java/org/apache/shardingsphere/driver/data/pipeline/datasource/creator/ShardingSpherePipelineDataSourceCreator.java
index 908b5460d2f..2f958bf4002 100644
--- a/jdbc/core/src/main/java/org/apache/shardingsphere/driver/data/pipeline/datasource/creator/ShardingSpherePipelineDataSourceCreator.java
+++ b/jdbc/core/src/main/java/org/apache/shardingsphere/driver/data/pipeline/datasource/creator/ShardingSpherePipelineDataSourceCreator.java
@@ -18,7 +18,7 @@
 package org.apache.shardingsphere.driver.data.pipeline.datasource.creator;
 
 import org.apache.shardingsphere.data.pipeline.api.datasource.config.impl.ShardingSpherePipelineDataSourceConfiguration;
-import org.apache.shardingsphere.data.pipeline.core.datasource.creator.PipelineDataSourceCreator;
+import org.apache.shardingsphere.data.pipeline.spi.datasource.creator.PipelineDataSourceCreator;
 import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
 import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
 import org.apache.shardingsphere.infra.datasource.pool.destroyer.DataSourcePoolDestroyer;
diff --git a/jdbc/core/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.datasource.creator.PipelineDataSourceCreator b/jdbc/core/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.spi.datasource.creator.PipelineDataSourceCreator
similarity index 100%
rename from jdbc/core/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.datasource.creator.PipelineDataSourceCreator
rename to jdbc/core/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.spi.datasource.creator.PipelineDataSourceCreator
diff --git a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/PipelineDataSourceCreator.java b/kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/spi/datasource/creator/PipelineDataSourceCreator.java
similarity index 95%
rename from kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/PipelineDataSourceCreator.java
rename to kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/spi/datasource/creator/PipelineDataSourceCreator.java
index e358387c348..57e0894e34a 100644
--- a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/PipelineDataSourceCreator.java
+++ b/kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/spi/datasource/creator/PipelineDataSourceCreator.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.data.pipeline.core.datasource.creator;
+package org.apache.shardingsphere.data.pipeline.spi.datasource.creator;
 
 import org.apache.shardingsphere.infra.util.spi.annotation.SingletonSPI;
 import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
diff --git a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/PipelineDataSourceCreatorFactory.java b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/PipelineDataSourceCreatorFactory.java
index c5cee70e6b9..af281d9a622 100644
--- a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/PipelineDataSourceCreatorFactory.java
+++ b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/PipelineDataSourceCreatorFactory.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.data.pipeline.core.datasource.creator;
 
+import org.apache.shardingsphere.data.pipeline.spi.datasource.creator.PipelineDataSourceCreator;
 import org.apache.shardingsphere.infra.util.spi.ShardingSphereServiceLoader;
 import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPIRegistry;
 
diff --git a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/impl/StandardPipelineDataSourceCreator.java b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/impl/StandardPipelineDataSourceCreator.java
index 9905fef0e59..675a2c9b9c2 100644
--- a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/impl/StandardPipelineDataSourceCreator.java
+++ b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/impl/StandardPipelineDataSourceCreator.java
@@ -18,7 +18,7 @@
 package org.apache.shardingsphere.data.pipeline.core.datasource.creator.impl;
 
 import org.apache.shardingsphere.data.pipeline.api.datasource.config.impl.StandardPipelineDataSourceConfiguration;
-import org.apache.shardingsphere.data.pipeline.core.datasource.creator.PipelineDataSourceCreator;
+import org.apache.shardingsphere.data.pipeline.spi.datasource.creator.PipelineDataSourceCreator;
 import org.apache.shardingsphere.infra.datasource.pool.creator.DataSourcePoolCreator;
 import org.apache.shardingsphere.infra.datasource.props.DataSourceProperties;
 
diff --git a/kernel/data-pipeline/core/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.datasource.creator.PipelineDataSourceCreator b/kernel/data-pipeline/core/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.spi.datasource.creator.PipelineDataSourceCreator
similarity index 100%
rename from kernel/data-pipeline/core/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.datasource.creator.PipelineDataSourceCreator
rename to kernel/data-pipeline/core/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.spi.datasource.creator.PipelineDataSourceCreator
diff --git a/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/FixturePipelineDataSourceCreator.java b/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/FixturePipelineDataSourceCreator.java
index 5c3dc940e8e..aa0fa6120b7 100644
--- a/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/FixturePipelineDataSourceCreator.java
+++ b/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/FixturePipelineDataSourceCreator.java
@@ -17,6 +17,8 @@
 
 package org.apache.shardingsphere.data.pipeline.core.datasource.creator;
 
+import org.apache.shardingsphere.data.pipeline.spi.datasource.creator.PipelineDataSourceCreator;
+
 import javax.sql.DataSource;
 
 public final class FixturePipelineDataSourceCreator implements PipelineDataSourceCreator {
diff --git a/kernel/data-pipeline/core/src/test/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.datasource.creator.PipelineDataSourceCreator b/kernel/data-pipeline/core/src/test/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.spi.datasource.creator.PipelineDataSourceCreator
similarity index 100%
rename from kernel/data-pipeline/core/src/test/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.datasource.creator.PipelineDataSourceCreator
rename to kernel/data-pipeline/core/src/test/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.spi.datasource.creator.PipelineDataSourceCreator
diff --git a/test/pipeline/src/test/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/PipelineDataSourceCreatorFactoryTest.java b/test/pipeline/src/test/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/PipelineDataSourceCreatorFactoryTest.java
index 3649de8b106..847714a1b7a 100644
--- a/test/pipeline/src/test/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/PipelineDataSourceCreatorFactoryTest.java
+++ b/test/pipeline/src/test/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/PipelineDataSourceCreatorFactoryTest.java
@@ -21,6 +21,7 @@ import org.apache.commons.lang3.tuple.Pair;
 import org.apache.shardingsphere.data.pipeline.api.datasource.config.impl.ShardingSpherePipelineDataSourceConfiguration;
 import org.apache.shardingsphere.data.pipeline.api.datasource.config.impl.StandardPipelineDataSourceConfiguration;
 import org.apache.shardingsphere.data.pipeline.core.datasource.creator.impl.StandardPipelineDataSourceCreator;
+import org.apache.shardingsphere.data.pipeline.spi.datasource.creator.PipelineDataSourceCreator;
 import org.apache.shardingsphere.driver.data.pipeline.datasource.creator.ShardingSpherePipelineDataSourceCreator;
 import org.junit.Test;
 
diff --git a/test/rewrite/pom.xml b/test/rewrite/pom.xml
index 6b9b42b89c4..c90d8e4bfd0 100644
--- a/test/rewrite/pom.xml
+++ b/test/rewrite/pom.xml
@@ -52,6 +52,11 @@
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.shardingsphere</groupId>
+            <artifactId>shardingsphere-parser-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
         <dependency>
             <groupId>org.apache.shardingsphere</groupId>
             <artifactId>shardingsphere-sql-parser-sql92</artifactId>