Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into cdc
Browse files Browse the repository at this point in the history
  • Loading branch information
azexcy committed Nov 13, 2023
2 parents 18632b0 + 94a9e1c commit 11c4bc7
Show file tree
Hide file tree
Showing 455 changed files with 3,699 additions and 2,449 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public final class LogbackConfigurationFixture extends BasicConfigurator {
public static final String SHARDINGSPHERE_LOGGER_NAME = "org.apache.shardingsphere.agent";

@Override
public ExecutionStatus configure(final LoggerContext loggerContext) {
public void configure(final LoggerContext loggerContext) {
Appender<ILoggingEvent> appender = createFileAppender(loggerContext);
Logger rootLogger = loggerContext.getLogger(Logger.ROOT_LOGGER_NAME);
rootLogger.setLevel(Level.INFO);
Expand All @@ -48,7 +48,6 @@ public ExecutionStatus configure(final LoggerContext loggerContext) {
logger.setLevel(Level.INFO);
logger.setAdditive(false);
logger.addAppender(appender);
return ExecutionStatus.NEUTRAL;
}

private FileAppender<ILoggingEvent> createFileAppender(final LoggerContext loggerContext) {
Expand Down
1 change: 0 additions & 1 deletion distribution/proxy-native/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
<finalName>apache-shardingsphere-${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
Expand Down
15 changes: 7 additions & 8 deletions distribution/proxy-native/src/main/release-docs/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ The text of each license is the standard Apache 2.0 license.
jackson-databind 2.14.0: http://github.com/FasterXML/jackson, Apache 2.0
jackson-dataformat-yaml 2.14.0: http://github.com/FasterXML/jackson, Apache 2.0
jackson-datatype-jsr310 2.14.0: http://github.com/FasterXML/jackson, Apache 2.0
jcl-over-slf4j 2.0.9: https://github.com/qos-ch/slf4j, Apache 2.0
jcl-over-slf4j 1.7.36: https://github.com/qos-ch/slf4j, Apache 2.0
jetcd-api 0.7.6: https://github.com/etcd-io/jetcd, Apache 2.0
jetcd-common 0.7.6: https://github.com/etcd-io/jetcd, Apache 2.0
jetcd-core 0.7.6: https://github.com/etcd-io/jetcd, Apache 2.0
Expand Down Expand Up @@ -345,9 +345,8 @@ The text of each license is also included at licenses/LICENSE-[project].txt.

javax.activation-api 1.2.0: https://github.com/javaee/javax.annotation, CDDL
jta 1.1: http://jta-spec.java.net, CDDL
jaxb-api 2.3.0: http://www.oracle.com, CDDL
jaxb-core 2.3.0: http://www.oracle.com, CDDL
jaxb-impl 2.3.0 http://www.oracle.com, CDDL
jaxb-api 2.3.1: http://www.oracle.com, CDDL
jaxb-runtime 2.3.1 https://javaee.github.io/jaxb-v2/, CDDL

========================================================================
EPL licenses
Expand All @@ -356,8 +355,8 @@ EPL licenses
The following components are provided under the EPL License. See project link for details.
The text of each license is also included at licenses/LICENSE-[project].txt.

logback-classic 1.3.11: https://github.com/qos-ch/logback, EPL 1.0
logback-core 1.3.11: https://github.com/qos-ch/logback, EPL 1.0
logback-classic 1.2.12: https://github.com/qos-ch/logback, EPL 1.0
logback-core 1.2.12: https://github.com/qos-ch/logback, EPL 1.0
mchange-commons-java 0.2.15: https://github.com/swaldman/mchange-commons-java, EPL 1.0
h2 2.2.224: https://github.com/h2database/h2database, EPL 1.0

Expand All @@ -373,5 +372,5 @@ The text of each license is also included at licenses/LICENSE-[project].txt.
bctls-jdk15on 1.70: https://www.bouncycastle.org, MIT
bcutil-jdk15on 1.70: https://www.bouncycastle.org, MIT
checker-qual 3.39.0: https://github.com/typetools/checker-framework/blob/master/checker-qual, MIT
jul-to-slf4j 2.0.9: https://www.slf4j.org, MIT
slf4j-api 2.0.9: https://www.slf4j.org, MIT
jul-to-slf4j 1.7.36: https://www.slf4j.org, MIT
slf4j-api 1.7.36: https://www.slf4j.org, MIT
15 changes: 7 additions & 8 deletions distribution/proxy/src/main/release-docs/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ The text of each license is the standard Apache 2.0 license.
jackson-databind 2.14.0: http://github.com/FasterXML/jackson, Apache 2.0
jackson-dataformat-yaml 2.14.0: http://github.com/FasterXML/jackson, Apache 2.0
jackson-datatype-jsr310 2.14.0: http://github.com/FasterXML/jackson, Apache 2.0
jcl-over-slf4j 2.0.9: https://github.com/qos-ch/slf4j, Apache 2.0
jcl-over-slf4j 1.7.36: https://github.com/qos-ch/slf4j, Apache 2.0
jetcd-api 0.7.6: https://github.com/etcd-io/jetcd, Apache 2.0
jetcd-common 0.7.6: https://github.com/etcd-io/jetcd, Apache 2.0
jetcd-core 0.7.6: https://github.com/etcd-io/jetcd, Apache 2.0
Expand Down Expand Up @@ -345,9 +345,8 @@ The text of each license is also included at licenses/LICENSE-[project].txt.

javax.activation-api 1.2.0: https://github.com/javaee/javax.annotation, CDDL
jta 1.1: http://jta-spec.java.net, CDDL
jaxb-api 2.3.0: http://www.oracle.com, CDDL
jaxb-core 2.3.0: http://www.oracle.com, CDDL
jaxb-impl 2.3.0 http://www.oracle.com, CDDL
jaxb-api 2.3.1: http://www.oracle.com, CDDL
jaxb-runtime 2.3.1 https://javaee.github.io/jaxb-v2/, CDDL

========================================================================
EPL licenses
Expand All @@ -356,8 +355,8 @@ EPL licenses
The following components are provided under the EPL License. See project link for details.
The text of each license is also included at licenses/LICENSE-[project].txt.

logback-classic 1.3.11: https://github.com/qos-ch/logback, EPL 1.0
logback-core 1.3.11: https://github.com/qos-ch/logback, EPL 1.0
logback-classic 1.2.12: https://github.com/qos-ch/logback, EPL 1.0
logback-core 1.2.12: https://github.com/qos-ch/logback, EPL 1.0
mchange-commons-java 0.2.15: https://github.com/swaldman/mchange-commons-java, EPL 1.0
h2 2.2.224: https://github.com/h2database/h2database, EPL 1.0

Expand All @@ -373,5 +372,5 @@ The text of each license is also included at licenses/LICENSE-[project].txt.
bctls-jdk15on 1.70: https://www.bouncycastle.org, MIT
bcutil-jdk15on 1.70: https://www.bouncycastle.org, MIT
checker-qual 3.39.0: https://github.com/typetools/checker-framework/blob/master/checker-qual, MIT
jul-to-slf4j 2.0.9: https://www.slf4j.org, MIT
slf4j-api 2.0.9: https://www.slf4j.org, MIT
jul-to-slf4j 1.7.36: https://www.slf4j.org, MIT
slf4j-api 1.7.36: https://www.slf4j.org, MIT
4 changes: 2 additions & 2 deletions docs/community/content/powered-by/_index.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ chapter = true
<ul>
<li><a href="http://www.dangdang.com/" rel="nofollow">当当</a>:<a href="https://mp.weixin.qq.com/s/Dcs_2Mkdvd49_s40rlOHvw" rel="nofollow">用户案例</a></li>
<li><a href="https://www.zhuanzhuan.com/" rel="nofollow">转转</a>:<a href="https://mp.weixin.qq.com/s/WftCu5oD4TZ-Xcf4uELtKA" rel="nofollow">用户案例</a></li>
<li><a href="https://www.dewu.com/" rel="nofollow">得物</a>:<a href="https://mp.weixin.qq.com/s/mYWKF0Ipso4GqSLmF4C3tg" rel="nofollow">用户案例 1</a> & <a href="https://mp.weixin.qq.com/s/ZyMBRJqbDQWYxjqlGAquKQ" rel="nofollow">用户案例 2</a></li>
<li><a href="https://www.dewu.com/" rel="nofollow">得物</a>:<a href="https://mp.weixin.qq.com/s/mYWKF0Ipso4GqSLmF4C3tg" rel="nofollow">用户案例 1</a> & <a href="https://mp.weixin.qq.com/s/ZyMBRJqbDQWYxjqlGAquKQ" rel="nofollow">用户案例 2</a> & <a href="https://mp.weixin.qq.com/s/QxtCyNSvxzvJHxwdJzQKzw" rel="nofollow">用户案例 3</a></li>
<li><a href="http://game.163.com/" rel="nofollow">网易游戏</a></li>
<li><a href="https://www.vip.com/" rel="nofollow">唯品会</a></li>
<li><a href="https://www.joybuy.com/" rel="nofollow">京东商城海外站</a></li>
Expand Down Expand Up @@ -147,7 +147,7 @@ chapter = true

### 物流
<ul>
<li><a href="https://www.jdl.cn/" rel="nofollow">京东物流</a></li>
<li><a href="https://www.jdl.cn/" rel="nofollow">京东物流</a>:<a href="https://mp.weixin.qq.com/s/vFmBi3qnDdttUVlWA3jGXA" rel="nofollow">用户案例 1</a> & <a href="https://mp.weixin.qq.com/s/sFiLurNwC4ggBN7D-GWbYw" rel="nofollow">用户案例 2</a></li>
<li><a href="https://www.zto.com/" rel="nofollow">中通快递</a></li>
<li><a href="https://www.ishansong.com/" rel="nofollow">闪送</a></li>
<li><a href="http://www.yundaex.com/cn/index.php" rel="nofollow">韵达科技</a></li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Quarkus 3,Micronaut Framework 4 和 Helidon 3。
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.8</version>
<version>2.3.1</version>
</dependency>
</dependencies>
</project>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ also applies to other Jakarta EE-based Web Frameworks, such as Quarkus 3, Micron
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.8</version>
<version>2.3.1</version>
</dependency>
</dependencies>
</project>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,16 @@ weight = 3
{{% tab name="语法" %}}
```sql
UnregisterStorageUnit ::=
'UNREGISTER' 'STORAGE' 'UNIT' ifExists? storageUnitName (',' storageUnitName)* ('IGNORE' 'SINGLE' 'TABLES')?
'UNREGISTER' 'STORAGE' 'UNIT' ifExists? storageUnitName (',' storageUnitName)* (ignoreSingleTables | ignoreBroadcastTables | ignoreSingleAndBroadcastTables)?

ignoreSingleTables ::=
'IGNORE' 'SINGLE' 'TABLES'

ignoreBroadcastTables ::=
'IGNORE' 'BROADCAST' 'TABLES'

ignoreSingleAndBroadcastTables ::=
'IGNORE' ('SINGLE' ',' 'BROADCAST' | 'BROADCAST' ',' 'SINGLE') 'TABLES'

ifExists ::=
'IF' 'EXISTS'
Expand All @@ -31,7 +40,7 @@ storageUnitName ::=

- `UNREGISTER STORAGE UNIT` 只会移除 Proxy 中的存储单元,不会删除与存储单元对应的真实数据源;
- 无法移除已经被规则使用的存储单元。移除被规则使用的存储单元时会提示 `Storage unit are still in used`
- 将要移除的存储单元中仅包含 `SINGLE RULE`,且用户确认可以忽略该限制时,可添加 `IGNORE SINGLE TABLES` 关键字移除存储单元;
- 将要移除的存储单元中仅包含 `SINGLE RULE``BROADCAST RULE`,且用户确认可以忽略该限制时,可添加 `IGNORE SINGLE TABLES``IGNORE BROADCAST TABLES``IGNORE SINGLE, BROADCAST TABLES` 关键字移除存储单元;
- `ifExists` 子句用于避免 `Storage unit not exists` 错误。

### 示例
Expand All @@ -54,6 +63,18 @@ UNREGISTER STORAGE UNIT ds_0, ds_1;
UNREGISTER STORAGE UNIT ds_0 IGNORE SINGLE TABLES;
```

- 忽略广播表移除存储单元

```sql
UNREGISTER STORAGE UNIT ds_0 IGNORE BROADCAST TABLES;
```

- 忽略单表和广播表移除存储单元

```sql
UNREGISTER STORAGE UNIT ds_0 IGNORE SINGLE, BROADCAST TABLES;
```

- 使用 `ifExists` 子句移除存储单元

```sql
Expand All @@ -62,7 +83,7 @@ UNREGISTER STORAGE UNIT IF EXISTS ds_0;

### 保留字

`DROP``STORAGE``UNIT``IF``EXISTS``IGNORE``SINGLE``TABLES`
`DROP``STORAGE``UNIT``IF``EXISTS``IGNORE``SINGLE``BROADCAST``TABLES`

### 相关链接

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,16 @@ The `UNREGISTER STORAGE UNIT` syntax is used to unregister storage unit from the
{{% tab name="Grammar" %}}
```sql
UnregisterStorageUnit ::=
'UNREGISTER' 'STORAGE' 'UNIT' ifExists? storageUnitName (',' storageUnitName)* ('IGNORE' 'SINGLE' 'TABLES')?
'UNREGISTER' 'STORAGE' 'UNIT' ifExists? storageUnitName (',' storageUnitName)* (ignoreSingleTables | ignoreBroadcastTables | ignoreSingleAndBroadcastTables)?

ignoreSingleTables ::=
'IGNORE' 'SINGLE' 'TABLES'

ignoreBroadcastTables ::=
'IGNORE' 'BROADCAST' 'TABLES'

ignoreSingleAndBroadcastTables ::=
'IGNORE' ('SINGLE' ',' 'BROADCAST' | 'BROADCAST' ',' 'SINGLE') 'TABLES'

ifExists ::=
'IF' 'EXISTS'
Expand All @@ -33,8 +42,8 @@ storageUnitName ::=
unregistered;
- Unable to unregister storage unit already used by rules. `Storage unit are still in used.` will be prompted when removing
storage units used by rules;
- The storage unit need to be removed only contains `SINGLE RULE`, and when the user confirms that this restriction
can be ignored, the `IGNORE SINGLE TABLES` keyword can be added to remove the storage unit;
- The storage unit need to be removed only contains `SINGLE RULE`, `BROADCAST RULE` and when the user confirms that this restriction
can be ignored, the `IGNORE SINGLE TABLES`, `IGNORE BROADCAST TABLES`, `IGNORE SINGLE, BROADCAST TABLES` keyword can be added to remove the storage unit;
- `ifExists` clause is used for avoid `Storage unit not exists` error.

### Example
Expand All @@ -57,6 +66,14 @@ UNREGISTER STORAGE UNIT ds_0, ds_1;
UNREGISTER STORAGE UNIT ds_0 IGNORE SINGLE TABLES;
```

```sql
UNREGISTER STORAGE UNIT ds_0 IGNORE BROADCAST TABLES;
```

```sql
UNREGISTER STORAGE UNIT ds_0 IGNORE SINGLE, BROADCAST TABLES;
```

- Drop the storage unit with `ifExists` clause

```sql
Expand All @@ -65,7 +82,7 @@ UNREGISTER STORAGE UNIT IF EXISTS ds_0;

### Reserved word

`DROP`, `STORAGE`, `UNIT`, `IF`, `EXISTS`, `IGNORE`, `SINGLE`, `TABLES`
`DROP`, `STORAGE`, `UNIT`, `IF`, `EXISTS`, `IGNORE`, `SINGLE`, `BROADCAST`, `TABLES`

### Related links

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ proxy 已包含 PostgreSQL JDBC 驱动。
如果后端连接以下数据库,请下载相应 JDBC 驱动 jar 包,并将其放入 `${shardingsphere-proxy}/ext-lib` 目录。

| 数据库 | JDBC 驱动 | 参考 |
|-----------|---------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|
| MySQL | [mysql-connector-java-5.1.49.jar]( https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.49/mysql-connector-java-5.1.49.jar ) | [Connector/J Versions]( https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-versions.html ) |
| openGauss | [opengauss-jdbc-3.0.0.jar]( https://repo1.maven.org/maven2/org/opengauss/opengauss-jdbc/3.0.0/opengauss-jdbc-3.0.0.jar ) | |
| 数据库 | JDBC 驱动 |
|-----------|---------------------------------------------------------------------------------------------------------------------------------------|
| MySQL | [mysql-connector-java-5.1.49.jar]( https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.49/mysql-connector-java-5.1.49.jar ) |
| openGauss | [opengauss-jdbc-3.0.0.jar]( https://repo1.maven.org/maven2/org/opengauss/opengauss-jdbc/3.0.0/opengauss-jdbc-3.0.0.jar ) |

如果是异构迁移,源端支持范围更广的数据库。JDBC 驱动处理方式同上。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ Proxy has included JDBC driver of PostgreSQL.
If the backend is connected to the following databases, download the corresponding JDBC driver jar package and put it into the `${shardingsphere-proxy}/ext-lib` directory.

| Database | JDBC Driver | Reference |
|-----------|---------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|
| MySQL | [mysql-connector-java-5.1.49.jar]( https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.49/mysql-connector-java-5.1.49.jar ) | [Connector/J Versions]( https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-versions.html ) |
| openGauss | [opengauss-jdbc-3.0.0.jar]( https://repo1.maven.org/maven2/org/opengauss/opengauss-jdbc/3.0.0/opengauss-jdbc-3.0.0.jar ) | |
| Database | JDBC Driver |
|-----------|---------------------------------------------------------------------------------------------------------------------------------------|
| MySQL | [mysql-connector-java-5.1.49.jar]( https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.49/mysql-connector-java-5.1.49.jar ) |
| openGauss | [opengauss-jdbc-3.0.0.jar]( https://repo1.maven.org/maven2/org/opengauss/opengauss-jdbc/3.0.0/opengauss-jdbc-3.0.0.jar ) |

If you are migrating to a heterogeneous database, then you could use more types of database. Introduce JDBC driver as above too.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ $currentNode := . }}
{{ $permalink := string .Permalink }}
{{ $v5 := slice "5.4.0" "5.3.2" "5.3.1" "5.3.0" "5.2.1" "5.2.0" "5.1.2" "5.1.1" "5.1.0" "5.0.0"}}
{{ $v5 := slice "5.4.1" "5.4.0" "5.3.2" "5.3.1" "5.3.0" "5.2.1" "5.2.0" "5.1.2" "5.1.1" "5.1.0" "5.0.0"}}
{{ $v4 := slice "4.1.1" "4.1.0" "4.0.1" "4.0.0"}}
{{ $v3 := slice "3.1.0" "3.0.0"}}
{{ $v2 := slice "2.0.3" "2.0.2" "2.0.1" "2.0.0"}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
@Getter
public enum YamlExampleConfigurationSupportedValue {

MODES("modes", new HashSet<>(Arrays.asList("memory", "proxy", "cluster-zookeeper", "cluster-etcd", "standalone"))),
MODES("modes", new HashSet<>(Arrays.asList("proxy", "cluster-zookeeper", "cluster-etcd", "standalone"))),

TRANSACTIONS("transactions", new HashSet<>(Arrays.asList("local", "xa-atomikos", "xa-narayana", "base-seata"))),

FEATURES("features", new HashSet<>(Arrays.asList("shadow", "sharding", "readwrite-splitting", "encrypt", "db-discovery", "mask"))),
FEATURES("features", new HashSet<>(Arrays.asList("shadow", "sharding", "readwrite-splitting", "encrypt", "mask"))),

FRAMEWORKS("frameworks", new HashSet<>(Arrays.asList("jdbc", "spring-boot-starter-jdbc", "spring-boot-starter-jpa", "spring-boot-starter-mybatis", "spring-namespace-jdbc", "spring-namespace-jpa", "spring-namespace-mybatis")));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,24 @@
* limitations under the License.
*/

package org.apache.shardingsphere.test.it.data.pipeline.spi.job;
package org.apache.shardingsphere.encrypt.metadata.reviser.column;

import org.apache.shardingsphere.data.pipeline.common.job.type.JobCodeRegistry;
import org.apache.shardingsphere.data.pipeline.scenario.consistencycheck.ConsistencyCheckJobType;
import org.apache.shardingsphere.data.pipeline.scenario.migration.MigrationJobType;
import org.apache.shardingsphere.encrypt.rule.EncryptTable;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

class JobCodeRegistryTest {
class EncryptColumnNameReviserTest {

@Test
void assertGetJobType() {
assertThat(JobCodeRegistry.getJobType(MigrationJobType.TYPE_CODE), is("MIGRATION"));
assertThat(JobCodeRegistry.getJobType(ConsistencyCheckJobType.TYPE_CODE), is("CONSISTENCY_CHECK"));
void assertRevise() {
EncryptTable encryptTable = mock(EncryptTable.class);
EncryptColumnNameReviser encryptColumnNameReviser = new EncryptColumnNameReviser(encryptTable);
when(encryptTable.isCipherColumn("Cipher")).thenReturn(true);
when(encryptTable.getLogicColumnByCipherColumn("Cipher")).thenReturn("Logic");
Assertions.assertEquals("Logic", encryptColumnNameReviser.revise("Cipher"));
Assertions.assertEquals("NonCipher", encryptColumnNameReviser.revise("NonCipher"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import java.util.stream.Collectors;

/**
* Result set for show sharding table nodes.
* Show sharding table nodes executor.
*/
public final class ShowShardingTableNodesExecutor implements RQLExecutor<ShowShardingTableNodesStatement> {

Expand Down
Loading

0 comments on commit 11c4bc7

Please sign in to comment.