From f39709c2e5752418817273aaef9689aa4ef9e906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=98=8E=E4=BC=9F?= Date: Wed, 17 Jun 2020 13:30:35 +0800 Subject: [PATCH] budo-jdbc-sharding-proxy --- budo-excel-jdbc-driver/pom.xml | 47 ++++++++++++++--- budo-jdbc-sharding-proxy/README.md | 5 ++ budo-jdbc-sharding-proxy/pom.xml | 50 +++++++++++++++++++ .../proxy/recognizer/BudoMongoRecognizer.java | 6 +++ ...dbc.recognizer.spi.JDBCDriverURLRecognizer | 1 + .../jdbc/sharding/proxy/ShardingProxy.java | 12 +++++ .../resources/conf/config-master-only.yaml | 6 +++ .../src/test/resources/conf/server.yaml | 9 ++++ .../resources/conf/config-master-only.yaml | 6 +++ .../src/test/resources/conf/server.yaml | 9 ++++ pom.xml | 3 +- 11 files changed, 145 insertions(+), 9 deletions(-) create mode 100644 budo-jdbc-sharding-proxy/README.md create mode 100644 budo-jdbc-sharding-proxy/pom.xml create mode 100644 budo-jdbc-sharding-proxy/src/main/java/org/budo/jdbc/sharding/proxy/recognizer/BudoMongoRecognizer.java create mode 100644 budo-jdbc-sharding-proxy/src/main/resources/services/org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.recognizer.spi.JDBCDriverURLRecognizer create mode 100644 budo-jdbc-sharding-proxy/src/test/java/org/budo/jdbc/sharding/proxy/ShardingProxy.java create mode 100644 budo-jdbc-sharding-proxy/src/test/resources/conf/config-master-only.yaml create mode 100644 budo-jdbc-sharding-proxy/src/test/resources/conf/server.yaml create mode 100644 budo-mongo-jdbc-driver/src/test/resources/conf/config-master-only.yaml create mode 100644 budo-mongo-jdbc-driver/src/test/resources/conf/server.yaml diff --git a/budo-excel-jdbc-driver/pom.xml b/budo-excel-jdbc-driver/pom.xml index e4f2c9e..466dbdb 100644 --- a/budo-excel-jdbc-driver/pom.xml +++ b/budo-excel-jdbc-driver/pom.xml @@ -1,10 +1,41 @@ - - 4.0.0 - - budo-jdbc - budo-jdbc + + 4.0.0 + + org.budo + budo-excel-jdbc-driver 0.0.1-SNAPSHOT - - budo-excel-jdbc-driver - budo-excel-jdbc-driver + + + + budo-snapshot-repository + ${budo-snapshot-repository-url} + + + + + UTF-8 + UTF-8 + + 2.4.5 + + https://repo.rdc.aliyun.com/repository/1726-snapshot-ZLxSbx/ + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + UTF-8 + + + + \ No newline at end of file diff --git a/budo-jdbc-sharding-proxy/README.md b/budo-jdbc-sharding-proxy/README.md new file mode 100644 index 0000000..db24321 --- /dev/null +++ b/budo-jdbc-sharding-proxy/README.md @@ -0,0 +1,5 @@ +# budo-jdbc-sharding-proxy + +[shardingsphere-proxy-boot-mybatis-example](https://github.com/apache/shardingsphere/tree/master/examples/shardingsphere-proxy-example/shardingsphere-proxy-boot-mybatis-example/src/main/resources/conf) + +[shardingsphere-proxy-hint-example](https://github.com/apache/shardingsphere/tree/master/examples/shardingsphere-proxy-example/shardingsphere-proxy-hint-example/src/main/resources/conf) \ No newline at end of file diff --git a/budo-jdbc-sharding-proxy/pom.xml b/budo-jdbc-sharding-proxy/pom.xml new file mode 100644 index 0000000..f00c766 --- /dev/null +++ b/budo-jdbc-sharding-proxy/pom.xml @@ -0,0 +1,50 @@ + + 4.0.0 + + org.budo + budo-jdbc-sharding-proxy + 0.0.1-SNAPSHOT + + + + budo-snapshot-repository + ${budo-snapshot-repository-url} + + + + + UTF-8 + UTF-8 + + 2.4.5 + + https://repo.rdc.aliyun.com/repository/1726-snapshot-ZLxSbx/ + + + + + org.apache.shardingsphere + sharding-proxy-bootstrap + 4.0.0 + provided + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + UTF-8 + + + + + \ No newline at end of file diff --git a/budo-jdbc-sharding-proxy/src/main/java/org/budo/jdbc/sharding/proxy/recognizer/BudoMongoRecognizer.java b/budo-jdbc-sharding-proxy/src/main/java/org/budo/jdbc/sharding/proxy/recognizer/BudoMongoRecognizer.java new file mode 100644 index 0000000..e6138e2 --- /dev/null +++ b/budo-jdbc-sharding-proxy/src/main/java/org/budo/jdbc/sharding/proxy/recognizer/BudoMongoRecognizer.java @@ -0,0 +1,6 @@ +package org.budo.jdbc.sharding.proxy.recognizer; + +/** + * @author lmw + */ +public class BudoMongoRecognizer {} \ No newline at end of file diff --git a/budo-jdbc-sharding-proxy/src/main/resources/services/org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.recognizer.spi.JDBCDriverURLRecognizer b/budo-jdbc-sharding-proxy/src/main/resources/services/org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.recognizer.spi.JDBCDriverURLRecognizer new file mode 100644 index 0000000..b862a68 --- /dev/null +++ b/budo-jdbc-sharding-proxy/src/main/resources/services/org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.recognizer.spi.JDBCDriverURLRecognizer @@ -0,0 +1 @@ +org.budo.jdbc.sharding.proxy.recognizer.BudoMongoRecognizer \ No newline at end of file diff --git a/budo-jdbc-sharding-proxy/src/test/java/org/budo/jdbc/sharding/proxy/ShardingProxy.java b/budo-jdbc-sharding-proxy/src/test/java/org/budo/jdbc/sharding/proxy/ShardingProxy.java new file mode 100644 index 0000000..7fdbaad --- /dev/null +++ b/budo-jdbc-sharding-proxy/src/test/java/org/budo/jdbc/sharding/proxy/ShardingProxy.java @@ -0,0 +1,12 @@ +package org.budo.jdbc.sharding.proxy; + +import org.apache.shardingsphere.shardingproxy.Bootstrap; + +/** + * @author lmw + */ +public class ShardingProxy { + public static void main(String[] args) throws Throwable { + Bootstrap.main(args); + } +} \ No newline at end of file diff --git a/budo-jdbc-sharding-proxy/src/test/resources/conf/config-master-only.yaml b/budo-jdbc-sharding-proxy/src/test/resources/conf/config-master-only.yaml new file mode 100644 index 0000000..a2d1c1c --- /dev/null +++ b/budo-jdbc-sharding-proxy/src/test/resources/conf/config-master-only.yaml @@ -0,0 +1,6 @@ + +schemaName: master_only + +dataSources: + ds_master: + url: jdbc:mysql://192.168.4.32:27017/taobao \ No newline at end of file diff --git a/budo-jdbc-sharding-proxy/src/test/resources/conf/server.yaml b/budo-jdbc-sharding-proxy/src/test/resources/conf/server.yaml new file mode 100644 index 0000000..b449d47 --- /dev/null +++ b/budo-jdbc-sharding-proxy/src/test/resources/conf/server.yaml @@ -0,0 +1,9 @@ +authentication: + users: + root: + password: root + +props: + max.connections.size.per.query: 1 + proxy.transaction.type: LOCAL + sql.show: false \ No newline at end of file diff --git a/budo-mongo-jdbc-driver/src/test/resources/conf/config-master-only.yaml b/budo-mongo-jdbc-driver/src/test/resources/conf/config-master-only.yaml new file mode 100644 index 0000000..a2d1c1c --- /dev/null +++ b/budo-mongo-jdbc-driver/src/test/resources/conf/config-master-only.yaml @@ -0,0 +1,6 @@ + +schemaName: master_only + +dataSources: + ds_master: + url: jdbc:mysql://192.168.4.32:27017/taobao \ No newline at end of file diff --git a/budo-mongo-jdbc-driver/src/test/resources/conf/server.yaml b/budo-mongo-jdbc-driver/src/test/resources/conf/server.yaml new file mode 100644 index 0000000..b449d47 --- /dev/null +++ b/budo-mongo-jdbc-driver/src/test/resources/conf/server.yaml @@ -0,0 +1,9 @@ +authentication: + users: + root: + password: root + +props: + max.connections.size.per.query: 1 + proxy.transaction.type: LOCAL + sql.show: false \ No newline at end of file diff --git a/pom.xml b/pom.xml index 81e430e..d673950 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - budo-jdbc + org.budo budo-jdbc 0.0.1-SNAPSHOT @@ -24,5 +24,6 @@ budo-mongo-jdbc-driver budo-redis-jdbc-driver budo-solr-jdbc-driver + budo-jdbc-sharding-proxy \ No newline at end of file