You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by ji...@apache.org on 2022/04/28 16:04:54 UTC

[shardingsphere] branch master updated: Remove spi mode in class-based-sharding-spring-boot-mybatis-example. (#17180)

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

jianglongtao 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 d9783c49073 Remove spi mode in class-based-sharding-spring-boot-mybatis-example. (#17180)
d9783c49073 is described below

commit d9783c49073689d8454421558b007730db87fd77
Author: yx9o <ya...@163.com>
AuthorDate: Fri Apr 29 00:04:44 2022 +0800

    Remove spi mode in class-based-sharding-spring-boot-mybatis-example. (#17180)
---
 ...DatasourceStandardShardingAlgorithmFixture.java |  2 +-
 ...dOrderItemStandardShardingAlgorithmFixture.java |  2 +-
 ...BasedOrderStandardShardingAlgorithmFixture.java |  2 +-
 ...e.shardingsphere.sharding.spi.ShardingAlgorithm | 20 --------
 .../application-sharding-auto-tables.properties    | 57 ----------------------
 ...pplication-sharding-databases-tables.properties | 12 +++--
 .../application-sharding-databases.properties      |  4 +-
 .../application-sharding-tables.properties         | 11 +++--
 .../src/main/resources/application.properties      |  1 -
 9 files changed, 21 insertions(+), 90 deletions(-)

diff --git a/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/java/org/apache/shardingsphere/example/extension/classbased/sharding/spring/boot/mybatis/fixture/ClassBasedDatasourceStandardShardingAlgorithmFixture.java b/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/cl [...]
index bd725966482..ce14835fd03 100644
--- a/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/java/org/apache/shardingsphere/example/extension/classbased/sharding/spring/boot/mybatis/fixture/ClassBasedDatasourceStandardShardingAlgorithmFixture.java
+++ b/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/java/org/apache/shardingsphere/example/extension/classbased/sharding/spring/boot/mybatis/fixture/ClassBasedDatasourceStandardShardingAlgorithmFixture.java
@@ -62,6 +62,6 @@ public final class ClassBasedDatasourceStandardShardingAlgorithmFixture implemen
     
     @Override
     public String getType() {
-        return "DATASOURCE_CLASS_BASED";
+        return null;
     }
 }
diff --git a/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/java/org/apache/shardingsphere/example/extension/classbased/sharding/spring/boot/mybatis/fixture/ClassBasedOrderItemStandardShardingAlgorithmFixture.java b/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/cla [...]
index b1f7863a9fa..8244152fa22 100644
--- a/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/java/org/apache/shardingsphere/example/extension/classbased/sharding/spring/boot/mybatis/fixture/ClassBasedOrderItemStandardShardingAlgorithmFixture.java
+++ b/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/java/org/apache/shardingsphere/example/extension/classbased/sharding/spring/boot/mybatis/fixture/ClassBasedOrderItemStandardShardingAlgorithmFixture.java
@@ -62,6 +62,6 @@ public final class ClassBasedOrderItemStandardShardingAlgorithmFixture implement
     
     @Override
     public String getType() {
-        return "T_ORDER_ITEM_CLASS_BASED";
+        return null;
     }
 }
diff --git a/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/java/org/apache/shardingsphere/example/extension/classbased/sharding/spring/boot/mybatis/fixture/ClassBasedOrderStandardShardingAlgorithmFixture.java b/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-b [...]
index aeecdd6f4bb..0af5ba6f3bb 100644
--- a/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/java/org/apache/shardingsphere/example/extension/classbased/sharding/spring/boot/mybatis/fixture/ClassBasedOrderStandardShardingAlgorithmFixture.java
+++ b/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/java/org/apache/shardingsphere/example/extension/classbased/sharding/spring/boot/mybatis/fixture/ClassBasedOrderStandardShardingAlgorithmFixture.java
@@ -62,6 +62,6 @@ public final class ClassBasedOrderStandardShardingAlgorithmFixture implements St
     
     @Override
     public String getType() {
-        return "T_ORDER_CLASS_BASED";
+        return null;
     }
 }
diff --git a/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.ShardingAlgorithm b/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot- [...]
deleted file mode 100644
index 0aec5b18370..00000000000
--- a/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.ShardingAlgorithm
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# 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.
-#
-
-org.apache.shardingsphere.example.extension.classbased.sharding.spring.boot.mybatis.fixture.ClassBasedDatasourceStandardShardingAlgorithmFixture
-org.apache.shardingsphere.example.extension.classbased.sharding.spring.boot.mybatis.fixture.ClassBasedOrderStandardShardingAlgorithmFixture
-org.apache.shardingsphere.example.extension.classbased.sharding.spring.boot.mybatis.fixture.ClassBasedOrderItemStandardShardingAlgorithmFixture
diff --git a/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/resources/application-sharding-auto-tables.properties b/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/resour [...]
deleted file mode 100644
index 3d26fc6e110..00000000000
--- a/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/resources/application-sharding-auto-tables.properties
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# 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.
-#
-
-spring.shardingsphere.datasource.names=ds-0,ds-1
-
-spring.shardingsphere.datasource.ds-0.jdbc-url=jdbc:mysql://127.0.0.1:3306/demo_ds_0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
-spring.shardingsphere.datasource.ds-0.type=com.zaxxer.hikari.HikariDataSource
-spring.shardingsphere.datasource.ds-0.driver-class-name=com.mysql.jdbc.Driver
-spring.shardingsphere.datasource.ds-0.username=root
-spring.shardingsphere.datasource.ds-0.password=
-
-spring.shardingsphere.datasource.ds-1.jdbc-url=jdbc:mysql://127.0.0.1:3306/demo_ds_1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
-spring.shardingsphere.datasource.ds-1.type=com.zaxxer.hikari.HikariDataSource
-spring.shardingsphere.datasource.ds-1.driver-class-name=com.mysql.jdbc.Driver
-spring.shardingsphere.datasource.ds-1.username=root
-spring.shardingsphere.datasource.ds-1.password=
-
-spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-column=user_id
-spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-algorithm-name=database-inline
-spring.shardingsphere.rules.sharding.binding-tables[0]=t_order,t_order_item
-
-spring.shardingsphere.rules.sharding.autotables.t_order.actual-datasources=ds-${0..1}
-
-spring.shardingsphere.rules.sharding.auto-tables.t_order.sharding-strategy.standard.sharding-column=order_id
-spring.shardingsphere.rules.sharding.auto-tables.t_order.sharding-strategy.standard.sharding-algorithm-name=auto-mod
-
-spring.shardingsphere.rules.sharding.auto-tables.t_order.key-generate-strategy.column=order_id
-spring.shardingsphere.rules.sharding.auto-tables.t_order.key-generate-strategy.key-generator-name=snowflake
-
-spring.shardingsphere.rules.sharding.auto-tables.t_order_item.actual-datasources=ds-${0..1}
-
-spring.shardingsphere.rules.sharding.auto-tables.t_order_item.sharding-strategy.standard.sharding-column=order_item_id
-spring.shardingsphere.rules.sharding.auto-tables.t_order_item.sharding-strategy.standard.sharding-algorithm-name=auto-mod
-
-spring.shardingsphere.rules.sharding.auto-tables.t_order_item.key-generate-strategy.column=order_item_id
-spring.shardingsphere.rules.sharding.auto-tables.t_order_item.key-generate-strategy.key-generator-name=snowflake
-
-spring.shardingsphere.rules.sharding.sharding-algorithms.auto-mod.type=mod
-spring.shardingsphere.rules.sharding.sharding-algorithms.auto-mod.props.sharding-count=2
-
-spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
-
-spring.shardingsphere.props.sql-show=true
diff --git a/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/resources/application-sharding-databases-tables.properties b/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/r [...]
index 7e9ecb10c88..b05535e29f5 100644
--- a/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/resources/application-sharding-databases-tables.properties
+++ b/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/resources/application-sharding-databases-tables.properties
@@ -52,11 +52,17 @@ spring.shardingsphere.rules.sharding.tables.t_order_item.table-strategy.standard
 spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.column=order_item_id
 spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.key-generator-name=snowflake
 
-spring.shardingsphere.rules.sharding.sharding-algorithms.datasource-class-based.type=DATASOURCE_CLASS_BASED
+spring.shardingsphere.rules.sharding.sharding-algorithms.datasource-class-based.type=CLASS_BASED
+spring.shardingsphere.rules.sharding.sharding-algorithms.datasource-class-based.props.strategy=standard
+spring.shardingsphere.rules.sharding.sharding-algorithms.datasource-class-based.props.algorithmClassName=org.apache.shardingsphere.example.extension.classbased.sharding.spring.boot.mybatis.fixture.ClassBasedDatasourceStandardShardingAlgorithmFixture
 spring.shardingsphere.rules.sharding.sharding-algorithms.datasource-class-based.props.sharding-count=2
-spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-class-based.type=T_ORDER_CLASS_BASED
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-class-based.type=CLASS_BASED
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-class-based.props.strategy=standard
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-class-based.props.algorithmClassName=org.apache.shardingsphere.example.extension.classbased.sharding.spring.boot.mybatis.fixture.ClassBasedOrderStandardShardingAlgorithmFixture
 spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-class-based.props.sharding-count=2
-spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-item-class-based.type=T_ORDER_ITEM_CLASS_BASED
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-item-class-based.type=CLASS_BASED
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-item-class-based.props.strategy=standard
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-item-class-based.props.algorithmClassName=org.apache.shardingsphere.example.extension.classbased.sharding.spring.boot.mybatis.fixture.ClassBasedOrderItemStandardShardingAlgorithmFixture
 spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-item-class-based.props.sharding-count=2
 
 spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
diff --git a/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/resources/application-sharding-databases.properties b/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/resource [...]
index b5fe9420dae..21184eaad0f 100644
--- a/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/resources/application-sharding-databases.properties
+++ b/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/resources/application-sharding-databases.properties
@@ -44,7 +44,9 @@ spring.shardingsphere.rules.sharding.tables.t_order_item.actual-data-nodes=ds-$-
 spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.column=order_item_id
 spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.key-generator-name=snowflake
 
-spring.shardingsphere.rules.sharding.sharding-algorithms.datasource-class-based.type=DATASOURCE_CLASS_BASED
+spring.shardingsphere.rules.sharding.sharding-algorithms.datasource-class-based.type=CLASS_BASED
+spring.shardingsphere.rules.sharding.sharding-algorithms.datasource-class-based.props.strategy=standard
+spring.shardingsphere.rules.sharding.sharding-algorithms.datasource-class-based.props.algorithmClassName=org.apache.shardingsphere.example.extension.classbased.sharding.spring.boot.mybatis.fixture.ClassBasedDatasourceStandardShardingAlgorithmFixture
 spring.shardingsphere.rules.sharding.sharding-algorithms.datasource-class-based.props.sharding-count=2
 
 spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
diff --git a/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/resources/application-sharding-tables.properties b/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/resources/a [...]
index 905dea99f7b..ac4ec5dfc97 100644
--- a/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/resources/application-sharding-tables.properties
+++ b/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/resources/application-sharding-tables.properties
@@ -15,8 +15,6 @@
 # limitations under the License.
 #
 
-spring.shardingsphere.mode.type=Memory
-
 spring.shardingsphere.datasource.names=ds
 
 spring.shardingsphere.datasource.ds.type=com.zaxxer.hikari.HikariDataSource
@@ -42,12 +40,15 @@ spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.k
 spring.shardingsphere.rules.sharding.binding-tables[0]=t_order,t_order_item
 spring.shardingsphere.rules.sharding.broadcast-tables=t_address
 
-spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-class-based.type=T_ORDER_CLASS_BASED
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-class-based.type=CLASS_BASED
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-class-based.props.strategy=standard
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-class-based.props.algorithmClassName=org.apache.shardingsphere.example.extension.classbased.sharding.spring.boot.mybatis.fixture.ClassBasedOrderStandardShardingAlgorithmFixture
 spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-class-based.props.sharding-count=2
-spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-item-class-based.type=T_ORDER_ITEM_CLASS_BASED
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-item-class-based.type=CLASS_BASED
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-item-class-based.props.strategy=standard
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-item-class-based.props.algorithmClassName=org.apache.shardingsphere.example.extension.classbased.sharding.spring.boot.mybatis.fixture.ClassBasedOrderItemStandardShardingAlgorithmFixture
 spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-item-class-based.props.sharding-count=2
 
-
 spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
 
 spring.shardingsphere.props.sql-show=true
diff --git a/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/resources/application.properties b/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/resources/application.properties
index 7b1c953e881..7a990a2a16d 100644
--- a/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/resources/application.properties
+++ b/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/resources/application.properties
@@ -20,4 +20,3 @@ mybatis.config-location=classpath:META-INF/mybatis-config.xml
 spring.profiles.active=sharding-databases-tables
 #spring.profiles.active=sharding-tables
 #spring.profiles.active=sharding-databases
-#spring.profiles.active=sharding-auto-tables