未验证 提交 cf5ac7e2 编写于 作者: L Liang Zhang 提交者: GitHub

Revise exapmles (#5656)

* fix example pom

* rename sharding-jdbc-example to shardingsphere-jdbc-example

* rename sharding-proxy-example to shardingsphere-proxy-example

* for code style

* fix log

* revise code with sharding-proxy
上级 02b6c14d
......@@ -55,7 +55,7 @@ shardingsphere-example
│   ├── example-raw-jdbc
│   ├── example-spring-jpa
│   └── example-spring-mybatis
├── sharding-jdbc-example
├── shardingsphere-jdbc-example
│   ├── sharding-example
│   │   ├── sharding-raw-jdbc-example
│   │   ├── sharding-spring-boot-jpa-example
......@@ -72,8 +72,9 @@ shardingsphere-example
│   ├── other-feature-example
│   │   ├── hint-example
│   │   └── encrypt-example
├── sharding-proxy-example
│   └── sharding-proxy-boot-mybatis-example
├── shardingsphere-proxy-example
│   ├── shardingsphere-proxy-boot-mybatis-example
│   └── shardingsphere-proxy-hint-example
└── src/resources
  └── manual_schema.sql
```
......@@ -86,29 +87,29 @@ shardingsphere-example
* master-slave
* sharding & master-slave
You can get more detail from **[sharding-example](./sharding-jdbc-example/sharding-example)**
You can get more detail from **[sharding-example](sharding-jdbc-example/sharding-example)**
### Best practice for sharding + orchestration
* using local configuration file for zookeeper/etcd & sharding
* using register center(zookeeper/etcd)'s configuration for sharding
You can get more detail from **[orchestration-example](./sharding-jdbc-example/orchestration-example)**
You can get more detail from **[orchestration-example](sharding-jdbc-example/orchestration-example)**
### Best Practice for sharding + distribution-transaction
* 2pc-xa transaction
* base-seata transaction
You can get more detail from **[transaction-example](./sharding-jdbc-example/transaction-example)**
You can get more detail from **[transaction-example](sharding-jdbc-example/transaction-example)**
### Best Practice for hint routing
You can get more detail from **[hint-example](./sharding-jdbc-example/other-feature-example/hint-example)**
You can get more detail from **[hint-example](sharding-jdbc-example/other-feature-example/hint-example)**
### Best Practice for data encrypt
You can get more detail from **[encrypt-example](./sharding-jdbc-example/other-feature-example/encrypt-example)**
You can get more detail from **[encrypt-example](sharding-jdbc-example/other-feature-example/encrypt-example)**
### Best Practice for APM Integration
......
......@@ -54,7 +54,7 @@ shardingsphere-example
│   ├── example-raw-jdbc
│   ├── example-spring-jpa
│   └── example-spring-mybatis
├── sharding-jdbc-example
├── shardingsphere-jdbc-example
│   ├── sharding-example
│   │   ├── sharding-raw-jdbc-example
│   │   ├── sharding-spring-boot-jpa-example
......@@ -71,8 +71,9 @@ shardingsphere-example
│   ├── other-feature-example
│   │   ├── hint-example
│   │   └── encrypt-example
├── sharding-proxy-example
│   └── sharding-proxy-boot-mybatis-example
├── shardingsphere-proxy-example
│   ├── shardingsphere-proxy-boot-mybatis-example
│   └── shardingsphere-proxy-hint-example
└── src/resources
  └── manual_schema.sql
```
......@@ -85,29 +86,29 @@ shardingsphere-example
* 主从
* 分片和主从
您可以从[sharding-example](./sharding-jdbc-example/sharding-example)中获取更多详细信息
您可以从[sharding-example](sharding-jdbc-example/sharding-example)中获取更多详细信息
### 分片与编排的最佳实践
* 使用本地配置文件和zookeeper/etcd配置分片
* 使用注册中心(zookeeper/etcd)的配置进行分片
您可以从业务[orchestration-example](./sharding-jdbc-example/orchestration-example)中获取更多细节
您可以从业务[orchestration-example](sharding-jdbc-example/orchestration-example)中获取更多细节
### 分片+分布式事务的最佳实践
* 2pc-xa事务
* base-seata事务
您可以从[transaction-example](./sharding-jdbc-example/transaction-example)中获取更多详细信息
您可以从[transaction-example](sharding-jdbc-example/transaction-example)中获取更多详细信息
### 提示路由的最佳实践
您可以从[hint-example](./sharding-jdbc-example/other-feature-example/hint-example)中获取更多细节
您可以从[hint-example](sharding-jdbc-example/other-feature-example/hint-example)中获取更多细节
### 数据加密的最佳实践
您可以从[encrypt-example](./sharding-jdbc-example/other-feature-example/encrypt-example)中获取更多详细信息
您可以从[encrypt-example](sharding-jdbc-example/other-feature-example/encrypt-example)中获取更多详细信息
### APM集成的最佳实践
......
......@@ -25,9 +25,8 @@
<artifactId>example-core</artifactId>
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
<artifactId>config-utility</artifactId>
<name>common::config-utility</name>
<name>${project.artifactId}</name>
<dependencies>
<dependency>
......
......@@ -26,5 +26,5 @@
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
<artifactId>example-api</artifactId>
<name>common::example-core::example-api</name>
<name>${project.artifactId}</name>
</project>
......@@ -26,7 +26,7 @@
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
<artifactId>example-raw-jdbc</artifactId>
<name>common::example-raw-jdbc</name>
<name>${project.artifactId}</name>
<dependencies>
<dependency>
......
......@@ -26,7 +26,7 @@
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
<artifactId>example-spring-jpa</artifactId>
<name>common::example-spring-jpa</name>
<name>${project.artifactId}</name>
<dependencies>
<dependency>
......@@ -39,6 +39,7 @@
<artifactId>example-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
......
......@@ -26,8 +26,7 @@
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
<artifactId>example-core</artifactId>
<name>common::root</name>
<name>${project.artifactId}</name>
<packaging>pom</packaging>
<modules>
......
......@@ -23,17 +23,15 @@
<groupId>org.apache.shardingsphere.example</groupId>
<artifactId>shardingsphere-example</artifactId>
<version>5.0.0-RC1-SNAPSHOT</version>
<name>${project.artifactId}</name>
<packaging>pom</packaging>
<modules>
<module>example-core</module>
<module>sharding-jdbc-example</module>
<module>sharding-proxy-example</module>
<module>shardingsphere-jdbc-example</module>
<module>shardingsphere-proxy-example</module>
</modules>
<name>Example::root</name>
<packaging>pom</packaging>
<properties>
<java.version>1.8</java.version>
<maven.version.range>[3.0.4,)</maven.version.range>
......@@ -55,13 +53,13 @@
<mybatis-spring.version>1.3.0</mybatis-spring.version>
<jpa.version>1.0.0.Final</jpa.version>
<hibernate.version>4.3.11.Final</hibernate.version>
<seata.version>1.0.0</seata.version>
<junit.version>4.12</junit.version>
<hamcrest.version>1.3</hamcrest.version>
<mockito.version>2.7.21</mockito.version>
<apache-rat-plugin.version>0.12</apache-rat-plugin.version>
<maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
<maven-resources-plugin.version>2.7</maven-resources-plugin.version>
......
<?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.
-->
<configuration>
<property name="log.context.name" value="sharding-jdbc-spring-namespace-mybatis-example" />
<property name="log.charset" value="UTF-8" />
<property name="log.pattern" value="[%-5level] %date --%thread-- [%logger] %msg %n" />
<contextName>${log.context.name}</contextName>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder charset="${log.charset}">
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<root>
<level value="INFO" />
<appender-ref ref="STDOUT" />
</root>
</configuration>
<?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.
-->
<configuration>
<property name="log.context.name" value="sharding-jdbc-spring-namespace-jpa-quickstart" />
<property name="log.charset" value="UTF-8" />
<property name="log.pattern" value="[%-5level] %date --%thread-- [%logger] %msg %n" />
<contextName>${log.context.name}</contextName>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder charset="${log.charset}">
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<root>
<level value="INFO" />
<appender-ref ref="STDOUT" />
</root>
</configuration>
<?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.
-->
<configuration>
<property name="log.context.name" value="sharding-jdbc-spring-namespace-mybatis-quickstart" />
<property name="log.charset" value="UTF-8" />
<property name="log.pattern" value="[%-5level] %date --%thread-- [%logger] %msg %n" />
<contextName>${log.context.name}</contextName>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder charset="${log.charset}">
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<root>
<level value="INFO" />
<appender-ref ref="STDOUT" />
</root>
</configuration>
<?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.
-->
<configuration>
<property name="log.context.name" value="sharding-proxy-hint-example" />
<property name="log.charset" value="UTF-8" />
<property name="log.pattern" value="[%-5level] %date --%thread-- [%logger] %msg %n" />
<contextName>${log.context.name}</contextName>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder charset="${log.charset}">
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<root>
<level value="INFO" />
<appender-ref ref="STDOUT" />
</root>
</configuration>
......@@ -26,7 +26,7 @@
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
<artifactId>orchestration-raw-jdbc-example</artifactId>
<name>Example::orchestration::raw-jdbc</name>
<name>${project.artifactId}</name>
<dependencies>
<dependency>
......
......@@ -26,7 +26,7 @@
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
<artifactId>orchestration-spring-boot-example</artifactId>
<name>Example::orchestration::spring-boot</name>
<name>${project.artifactId}</name>
<dependencies>
<dependency>
......
......@@ -26,7 +26,7 @@
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
<artifactId>orchestration-spring-namespace-example</artifactId>
<name>Example::orchestration::spring-namespace</name>
<name>${project.artifactId}</name>
<dependencies>
<dependency>
......
......@@ -22,11 +22,11 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.shardingsphere.example</groupId>
<artifactId>sharding-jdbc-example</artifactId>
<artifactId>shardingsphere-jdbc-example</artifactId>
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
<artifactId>orchestration-example</artifactId>
<name>Example::orchestration</name>
<name>${project.artifactId}</name>
<packaging>pom</packaging>
<modules>
......
......@@ -26,7 +26,7 @@
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
<artifactId>encrypt-raw-jdbc-example</artifactId>
<name>Example::encrypt::raw-jdbc</name>
<name>${project.artifactId}</name>
<dependencies>
<dependency>
......
......@@ -26,7 +26,7 @@
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
<artifactId>encrypt-spring-boot-example</artifactId>
<name>Example::encrypt::spring-boot</name>
<name>${project.artifactId}</name>
<dependencies>
<dependency>
......
......@@ -26,7 +26,7 @@
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
<artifactId>encrypt-spring-namespace-example</artifactId>
<name>Example::encrypt::spring-namespace</name>
<name>${project.artifactId}</name>
<dependencies>
<dependency>
......
......@@ -26,7 +26,7 @@
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
<artifactId>encrypt-example</artifactId>
<name>Example::encrypt::root</name>
<name>${project.artifactId}</name>
<packaging>pom</packaging>
......
......@@ -26,7 +26,7 @@
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
<artifactId>hint-raw-jdbc-example</artifactId>
<name>Example::hint::raw-jdbc</name>
<name>${project.artifactId}</name>
<dependencies>
<dependency>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册