You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2022/08/19 05:00:33 UTC
[shardingsphere] branch master updated: Refactor DistSQL drop scaling jobId to clean scaling jobId (#20282)
This is an automated email from the ASF dual-hosted git repository.
zhonghongsheng 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 78ef9595841 Refactor DistSQL drop scaling jobId to clean scaling jobId (#20282)
78ef9595841 is described below
commit 78ef9595841a850bbe9272b799c7db35855e5c3d
Author: Da Xiang Huang <lo...@foxmail.com>
AuthorDate: Fri Aug 19 13:00:25 2022 +0800
Refactor DistSQL drop scaling jobId to clean scaling jobId (#20282)
---
.../distsql/syntax/ral/_index.cn.md | 28 +++++++++++-----------
.../distsql/syntax/ral/_index.en.md | 28 +++++++++++-----------
...tionUpdater.java => CleanMigrationUpdater.java} | 10 ++++----
....shardingsphere.infra.distsql.update.RALUpdater | 2 +-
.../src/main/antlr4/imports/migration/Keyword.g4 | 4 ++++
.../main/antlr4/imports/migration/RALStatement.g4 | 4 ++--
.../parser/autogen/MigrationDistSQLStatement.g4 | 2 +-
.../core/MigrationDistSQLStatementVisitor.java | 11 ++++-----
...Statement.java => CleanMigrationStatement.java} | 2 +-
.../data/pipeline/cases/base/BaseITCase.java | 2 +-
.../UpdatableScalingRALStatementAssert.java | 10 ++++----
...ert.java => CleanMigrationStatementAssert.java} | 10 ++++----
.../jaxb/cases/domain/SQLParserTestCases.java | 6 ++---
...e.java => CleanMigrationStatementTestCase.java} | 4 ++--
.../src/main/resources/case/ral/migration.xml | 4 ++--
.../main/resources/sql/supported/ral/migration.xml | 2 +-
16 files changed, 66 insertions(+), 63 deletions(-)
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/_index.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/_index.cn.md
index 9a18d876846..0b4c94c2bb7 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/_index.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/_index.cn.md
@@ -20,20 +20,20 @@ RAL (Resource & Rule Administration Language) 为 Apache ShardingSphere 的管
## 弹性伸缩
-| 语句 | 说明 | 示例 |
-|:--------------------------------------------------- |:----------------------------------------------------- |:--------------------------------------- |
-| SHOW SCALING LIST | 查询运行列表 | SHOW SCALING LIST |
-| SHOW SCALING STATUS jobId | 查询任务状态,xx:任务 id | SHOW SCALING STATUS 1234 |
-| START SCALING jobId | 开始运行任务,xx:任务 id | START SCALING 1234 |
-| STOP SCALING jobId | 停止运行任务,xx:任务 id | STOP SCALING 12345 |
-| DROP SCALING jobId | 移除任务,xx:任务 id | DROP SCALING 1234 |
-| RESET SCALING jobId | 重置任务进度,xx:任务 id | RESET SCALING 1234 |
-| CHECK SCALING jobId | 数据一致性校验,使用 `server.yaml` 里的校验算法,xx:任务 id | CHECK SCALING 1234 |
-| SHOW SCALING CHECK ALGORITHMS | 展示可用的一致性校验算法 | SHOW SCALING CHECK ALGORITHMS |
-| CHECK SCALING jobId (by type(name=algorithmTypeName)? | 数据一致性校验,使用指定的校验算法 | CHECK SCALING 1234 by type(name="DEFAULT") |
-| STOP SCALING SOURCE WRITING jobId | 旧的 ShardingSphere 数据源停写,xx:任务 id | STOP SCALING SOURCE WRITING 1234 |
-| RESTORE SCALING SOURCE WRITING jobId | 旧的 ShardingSphere 数据源恢复写,xx:任务 id | RESTORE SCALING SOURCE WRITING 1234 |
-| APPLY SCALING jobId | 切换至新的 ShardingSphere 元数据,xx:任务 id | APPLY SCALING 1234 |
+| 语句 | 说明 | 示例 |
+|:------------------------------------------------------|:----------------------------------------------------- |:-------------------------------------------|
+| SHOW SCALING LIST | 查询运行列表 | SHOW SCALING LIST |
+| SHOW SCALING STATUS jobId | 查询任务状态,xx:任务 id | SHOW SCALING STATUS 1234 |
+| START SCALING jobId | 开始运行任务,xx:任务 id | START SCALING 1234 |
+| STOP SCALING jobId | 停止运行任务,xx:任务 id | STOP SCALING 12345 |
+| CLEAN SCALING jobId | 移除任务,xx:任务 id | CLEAN SCALING 1234 |
+| RESET SCALING jobId | 重置任务进度,xx:任务 id | RESET SCALING 1234 |
+| CHECK SCALING jobId | 数据一致性校验,使用 `server.yaml` 里的校验算法,xx:任务 id | CHECK SCALING 1234 |
+| SHOW SCALING CHECK ALGORITHMS | 展示可用的一致性校验算法 | SHOW SCALING CHECK ALGORITHMS |
+| CHECK SCALING jobId (by type(name=algorithmTypeName)? | 数据一致性校验,使用指定的校验算法 | CHECK SCALING 1234 by type(name="DEFAULT") |
+| STOP SCALING SOURCE WRITING jobId | 旧的 ShardingSphere 数据源停写,xx:任务 id | STOP SCALING SOURCE WRITING 1234 |
+| RESTORE SCALING SOURCE WRITING jobId | 旧的 ShardingSphere 数据源恢复写,xx:任务 id | RESTORE SCALING SOURCE WRITING 1234 |
+| APPLY SCALING jobId | 切换至新的 ShardingSphere 元数据,xx:任务 id | APPLY SCALING 1234 |
## 熔断
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/_index.en.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/_index.en.md
index 73c59b89863..dae2700fb35 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/_index.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/_index.en.md
@@ -20,20 +20,20 @@ RAL (Resource & Rule Administration Language) responsible for hint, circuit brea
## Scaling
-| Statement | Function | Example |
-|:---------------------------------------------------- |:----------------------------------------------------------------- |:---------------------------------------- |
-| SHOW SCALING LIST | Query running list | SHOW SCALING LIST |
-| SHOW SCALING STATUS jobId | Query scaling status, xx: jobId | SHOW SCALING STATUS 1234 |
-| START SCALING jobId | Start scaling, xx: jobId | START SCALING 1234 |
-| STOP SCALING jobId | Stop scaling, xx: jobId | STOP SCALING 1234 |
-| DROP SCALING jobId | Drop scaling, xx: jobId | DROP SCALING 1234 |
-| RESET SCALING jobId | reset progress, xx: jobId | RESET SCALING 1234 |
-| CHECK SCALING jobId | Data consistency check with algorithm in `server.yaml`, xx: jobId | CHECK SCALING 1234 |
-| SHOW SCALING CHECK ALGORITHMS | Show available consistency check algorithms | SHOW SCALING CHECK ALGORITHMS |
-| CHECK SCALING jobId (by type(name=algorithmTypeName)? | Data consistency check with defined algorithm | CHECK SCALING 1234 by type(name="DEFAULT") |
-| STOP SCALING SOURCE WRITING jobId | The source ShardingSphere data source is discontinued, xx: jobId | STOP SCALING SOURCE WRITING 1234 |
-| RESTORE SCALING SOURCE WRITING jobId | Restore source data source writing, xx: jobId | RESTORE SCALING SOURCE WRITING 1234 |
-| APPLY SCALING jobId | Switch to target ShardingSphere metadata, xx: jobId | APPLY SCALING 1234 |
+| Statement | Function | Example |
+|:------------------------------------------------------|:------------------------------------------------------------------|:-------------------------------------------|
+| SHOW SCALING LIST | Query running list | SHOW SCALING LIST |
+| SHOW SCALING STATUS jobId | Query scaling status, xx: jobId | SHOW SCALING STATUS 1234 |
+| START SCALING jobId | Start scaling, xx: jobId | START SCALING 1234 |
+| STOP SCALING jobId | Stop scaling, xx: jobId | STOP SCALING 1234 |
+| CLEAN SCALING jobId | Clean scaling, xx: jobId | CLEAN SCALING 1234 |
+| RESET SCALING jobId | reset progress, xx: jobId | RESET SCALING 1234 |
+| CHECK SCALING jobId | Data consistency check with algorithm in `server.yaml`, xx: jobId | CHECK SCALING 1234 |
+| SHOW SCALING CHECK ALGORITHMS | Show available consistency check algorithms | SHOW SCALING CHECK ALGORITHMS |
+| CHECK SCALING jobId (by type(name=algorithmTypeName)? | Data consistency check with defined algorithm | CHECK SCALING 1234 by type(name="DEFAULT") |
+| STOP SCALING SOURCE WRITING jobId | The source ShardingSphere data source is discontinued, xx: jobId | STOP SCALING SOURCE WRITING 1234 |
+| RESTORE SCALING SOURCE WRITING jobId | Restore source data source writing, xx: jobId | RESTORE SCALING SOURCE WRITING 1234 |
+| APPLY SCALING jobId | Switch to target ShardingSphere metadata, xx: jobId | APPLY SCALING 1234 |
## Circuit Breaker
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/migration/distsql/handler/update/DropMigrationUpdater.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/migration/distsql/handler/update/CleanMigrationUpdater.java
similarity index 78%
rename from shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/migration/distsql/handler/update/DropMigrationUpdater.java
rename to shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/migration/distsql/handler/update/CleanMigrationUpdater.java
index 1566c95a790..b72bbeb3165 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/migration/distsql/handler/update/DropMigrationUpdater.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/migration/distsql/handler/update/CleanMigrationUpdater.java
@@ -20,22 +20,22 @@ package org.apache.shardingsphere.migration.distsql.handler.update;
import org.apache.shardingsphere.data.pipeline.api.MigrationJobPublicAPI;
import org.apache.shardingsphere.data.pipeline.api.PipelineJobPublicAPIFactory;
import org.apache.shardingsphere.infra.distsql.update.RALUpdater;
-import org.apache.shardingsphere.migration.distsql.statement.DropMigrationStatement;
+import org.apache.shardingsphere.migration.distsql.statement.CleanMigrationStatement;
/**
- * Drop migration updater.
+ * Clean migration updater.
*/
-public final class DropMigrationUpdater implements RALUpdater<DropMigrationStatement> {
+public final class CleanMigrationUpdater implements RALUpdater<CleanMigrationStatement> {
private static final MigrationJobPublicAPI JOB_API = PipelineJobPublicAPIFactory.getMigrationJobPublicAPI();
@Override
- public void executeUpdate(final String databaseName, final DropMigrationStatement sqlStatement) {
+ public void executeUpdate(final String databaseName, final CleanMigrationStatement sqlStatement) {
JOB_API.remove(sqlStatement.getJobId());
}
@Override
public String getType() {
- return DropMigrationStatement.class.getName();
+ return CleanMigrationStatement.class.getName();
}
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.distsql.update.RALUpdater b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.distsql.update.RALUpdater
index 491c999ec22..d5e9ec7516e 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.distsql.update.RALUpdater
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.distsql.update.RALUpdater
@@ -19,7 +19,7 @@ org.apache.shardingsphere.migration.distsql.handler.update.MigrateTableUpdater
org.apache.shardingsphere.migration.distsql.handler.update.StartMigrationUpdater
org.apache.shardingsphere.migration.distsql.handler.update.StopMigrationUpdater
org.apache.shardingsphere.migration.distsql.handler.update.ResetMigrationUpdater
-org.apache.shardingsphere.migration.distsql.handler.update.DropMigrationUpdater
+org.apache.shardingsphere.migration.distsql.handler.update.CleanMigrationUpdater
org.apache.shardingsphere.migration.distsql.handler.update.StopMigrationSourceWritingUpdater
org.apache.shardingsphere.migration.distsql.handler.update.RestoreMigrationSourceWritingUpdater
org.apache.shardingsphere.migration.distsql.handler.update.ApplyMigrationUpdater
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/antlr4/imports/migration/Keyword.g4 b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/antlr4/imports/migration/Keyword.g4
index 839ec3509e4..e72a6827a47 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/antlr4/imports/migration/Keyword.g4
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/antlr4/imports/migration/Keyword.g4
@@ -218,3 +218,7 @@ ADD
RESOURCE
: R E S O U R C E
;
+
+CLEAN
+ : C L E A N
+ ;
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/antlr4/imports/migration/RALStatement.g4 b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/antlr4/imports/migration/RALStatement.g4
index 98ec3afba34..82f4e99aff8 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/antlr4/imports/migration/RALStatement.g4
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/antlr4/imports/migration/RALStatement.g4
@@ -39,8 +39,8 @@ stopScaling
: STOP SCALING jobId
;
-dropScaling
- : DROP SCALING jobId
+cleanScaling
+ : CLEAN SCALING jobId
;
resetScaling
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/antlr4/migration/org/apache/shardingsphere/distsql/parser/autogen/MigrationDistSQLStatement.g4 b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/antlr4/migration/org/apache/shardingsphere/distsql/parser/autogen/MigrationDistSQLStatement.g4
index 8aab59502dd..4d65113f249 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/antlr4/migration/org/apache/shardingsphere/distsql/parser/autogen/MigrationDistSQLStatement.g4
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/antlr4/migration/org/apache/shardingsphere/distsql/parser/autogen/MigrationDistSQLStatement.g4
@@ -25,7 +25,7 @@ execute
| migrateTable
| startScaling
| stopScaling
- | dropScaling
+ | cleanScaling
| resetScaling
| checkScaling
| showScalingCheckAlgorithms
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/java/org/apache/shardingsphere/migration/distsql/parser/core/MigrationDistSQLStatementVisitor.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/java/org/apache/shardingsphere/migration/distsql/parser/core/MigrationDistSQLStatementVisitor.java
index 07c7faac852..7c926671bed 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/java/org/apache/shardingsphere/migration/distsql/parser/core/MigrationDistSQLStatementVisitor.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/java/org/apache/shardingsphere/migration/distsql/parser/core/MigrationDistSQLStatementVisitor.java
@@ -30,8 +30,7 @@ import org.apache.shardingsphere.distsql.parser.autogen.MigrationDistSQLStatemen
import org.apache.shardingsphere.distsql.parser.autogen.MigrationDistSQLStatementParser.CreateShardingScalingRuleContext;
import org.apache.shardingsphere.distsql.parser.autogen.MigrationDistSQLStatementParser.DataConsistencyCheckerContext;
import org.apache.shardingsphere.distsql.parser.autogen.MigrationDistSQLStatementParser.DisableShardingScalingRuleContext;
-import org.apache.shardingsphere.distsql.parser.autogen.MigrationDistSQLStatementParser.DropScalingContext;
-import org.apache.shardingsphere.distsql.parser.autogen.MigrationDistSQLStatementParser.DropShardingScalingRuleContext;
+import org.apache.shardingsphere.distsql.parser.autogen.MigrationDistSQLStatementParser.CleanScalingContext;
import org.apache.shardingsphere.distsql.parser.autogen.MigrationDistSQLStatementParser.EnableShardingScalingRuleContext;
import org.apache.shardingsphere.distsql.parser.autogen.MigrationDistSQLStatementParser.InputDefinitionContext;
import org.apache.shardingsphere.distsql.parser.autogen.MigrationDistSQLStatementParser.MigrateTableContext;
@@ -64,7 +63,7 @@ import org.apache.shardingsphere.migration.distsql.statement.ApplyMigrationState
import org.apache.shardingsphere.migration.distsql.statement.CheckMigrationStatement;
import org.apache.shardingsphere.migration.distsql.statement.CreateShardingScalingRuleStatement;
import org.apache.shardingsphere.migration.distsql.statement.DisableShardingScalingRuleStatement;
-import org.apache.shardingsphere.migration.distsql.statement.DropMigrationStatement;
+import org.apache.shardingsphere.migration.distsql.statement.CleanMigrationStatement;
import org.apache.shardingsphere.migration.distsql.statement.DropShardingScalingRuleStatement;
import org.apache.shardingsphere.migration.distsql.statement.EnableShardingScalingRuleStatement;
import org.apache.shardingsphere.migration.distsql.statement.MigrateTableStatement;
@@ -122,8 +121,8 @@ public final class MigrationDistSQLStatementVisitor extends MigrationDistSQLStat
}
@Override
- public ASTNode visitDropScaling(final DropScalingContext ctx) {
- return new DropMigrationStatement(getIdentifierValue(ctx.jobId()));
+ public ASTNode visitCleanScaling(final CleanScalingContext ctx) {
+ return new CleanMigrationStatement(getIdentifierValue(ctx.jobId()));
}
@Override
@@ -242,7 +241,7 @@ public final class MigrationDistSQLStatementVisitor extends MigrationDistSQLStat
}
@Override
- public ASTNode visitDropShardingScalingRule(final DropShardingScalingRuleContext ctx) {
+ public ASTNode visitDropShardingScalingRule(final MigrationDistSQLStatementParser.DropShardingScalingRuleContext ctx) {
return new DropShardingScalingRuleStatement(null != ctx.ifExists(), getIdentifierValue(ctx.scalingName()));
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/migration/distsql/statement/DropMigrationStatement.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/migration/distsql/statement/CleanMigrationStatement.java
similarity index 93%
rename from shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/migration/distsql/statement/DropMigrationStatement.java
rename to shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/migration/distsql/statement/CleanMigrationStatement.java
index 7b6283cb7ea..38b70edb95d 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/migration/distsql/statement/DropMigrationStatement.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/migration/distsql/statement/CleanMigrationStatement.java
@@ -26,7 +26,7 @@ import org.apache.shardingsphere.distsql.parser.statement.ral.scaling.UpdatableS
*/
@RequiredArgsConstructor
@Getter
-public final class DropMigrationStatement extends UpdatableScalingRALStatement {
+public final class CleanMigrationStatement extends UpdatableScalingRALStatement {
private final String jobId;
}
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/base/BaseITCase.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/base/BaseITCase.java
index 7346aa0e655..ca163a23fa4 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/base/BaseITCase.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/base/BaseITCase.java
@@ -257,7 +257,7 @@ public abstract class BaseITCase {
List<Map<String, Object>> scalingList = jdbcTemplate.queryForList("SHOW SCALING LIST");
for (Map<String, Object> each : scalingList) {
String id = each.get("id").toString();
- executeWithLog(String.format("DROP SCALING '%s'", id), 0);
+ executeWithLog(String.format("CLEAN SCALING '%s'", id), 0);
}
} catch (final DataAccessException ex) {
log.error("Failed to show scaling list. {}", ex.getMessage());
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/ral/impl/migration/UpdatableScalingRALStatementAssert.java b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/ral/impl/migration/UpdatableScalingRALStatementAssert.java
index f697251cacf..8b4878c17ae 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/ral/impl/migration/UpdatableScalingRALStatementAssert.java
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/ral/impl/migration/UpdatableScalingRALStatementAssert.java
@@ -22,7 +22,7 @@ import lombok.NoArgsConstructor;
import org.apache.shardingsphere.distsql.parser.statement.ral.scaling.UpdatableScalingRALStatement;
import org.apache.shardingsphere.migration.distsql.statement.AddMigrationSourceResourceStatement;
import org.apache.shardingsphere.migration.distsql.statement.ApplyMigrationStatement;
-import org.apache.shardingsphere.migration.distsql.statement.DropMigrationStatement;
+import org.apache.shardingsphere.migration.distsql.statement.CleanMigrationStatement;
import org.apache.shardingsphere.migration.distsql.statement.MigrateTableStatement;
import org.apache.shardingsphere.migration.distsql.statement.ResetMigrationStatement;
import org.apache.shardingsphere.migration.distsql.statement.RestoreMigrationSourceWritingStatement;
@@ -32,7 +32,7 @@ import org.apache.shardingsphere.migration.distsql.statement.StopMigrationStatem
import org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
import org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.ral.impl.migration.update.AddMigrationSourceResourceStatementAssert;
import org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.ral.impl.migration.update.ApplyMigrationStatementAssert;
-import org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.ral.impl.migration.update.DropMigrationStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.ral.impl.migration.update.CleanMigrationStatementAssert;
import org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.ral.impl.migration.update.MigrateTableStatementAssert;
import org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.ral.impl.migration.update.ResetMigrationStatementAssert;
import org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.ral.impl.migration.update.RestoreMigrationSourceWritingStatementAssert;
@@ -43,7 +43,7 @@ import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain
import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.ApplyMigrationStatementTestCase;
import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.MigrateTableStatementTestCase;
import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.ResetMigrationStatementTestCase;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.DropMigrationStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.CleanMigrationStatementTestCase;
import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.RestoreMigrationSourceWritingStatementTestCase;
import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.StartMigrationStatementTestCase;
import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.StopMigrationSourceWritingStatementTestCase;
@@ -77,8 +77,8 @@ public final class UpdatableScalingRALStatementAssert {
StopMigrationStatementAssert.assertIs(assertContext, (StopMigrationStatement) actual, (StopMigrationStatementTestCase) expected);
} else if (actual instanceof ResetMigrationStatement) {
ResetMigrationStatementAssert.assertIs(assertContext, (ResetMigrationStatement) actual, (ResetMigrationStatementTestCase) expected);
- } else if (actual instanceof DropMigrationStatement) {
- DropMigrationStatementAssert.assertIs(assertContext, (DropMigrationStatement) actual, (DropMigrationStatementTestCase) expected);
+ } else if (actual instanceof CleanMigrationStatement) {
+ CleanMigrationStatementAssert.assertIs(assertContext, (CleanMigrationStatement) actual, (CleanMigrationStatementTestCase) expected);
} else if (actual instanceof StartMigrationStatement) {
StartMigrationStatementAssert.assertIs(assertContext, (StartMigrationStatement) actual, (StartMigrationStatementTestCase) expected);
} else if (actual instanceof AddMigrationSourceResourceStatement) {
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/ral/impl/migration/update/DropMigrationStatementAssert.java b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/ral/impl/migration/update/CleanMigrationStatementAssert.java
similarity index 87%
rename from shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/ral/impl/migration/update/DropMigrationStatementAssert.java
rename to shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/ral/impl/migration/update/CleanMigrationStatementAssert.java
index 85c0ba3e22a..77ba8b3e4f9 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/ral/impl/migration/update/DropMigrationStatementAssert.java
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/ral/impl/migration/update/CleanMigrationStatementAssert.java
@@ -17,9 +17,9 @@
package org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.ral.impl.migration.update;
-import org.apache.shardingsphere.migration.distsql.statement.DropMigrationStatement;
+import org.apache.shardingsphere.migration.distsql.statement.CleanMigrationStatement;
import org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.DropMigrationStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.CleanMigrationStatementTestCase;
import java.util.List;
@@ -29,9 +29,9 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
/**
- * Drop migration statement assert.
+ * Clean migration statement assert.
*/
-public final class DropMigrationStatementAssert {
+public final class CleanMigrationStatementAssert {
/**
* Assert drop migration statement is correct with expected parser result.
@@ -40,7 +40,7 @@ public final class DropMigrationStatementAssert {
* @param actual actual drop migration statement
* @param expected expected drop migration statement test case
*/
- public static void assertIs(final SQLCaseAssertContext assertContext, final DropMigrationStatement actual, final DropMigrationStatementTestCase expected) {
+ public static void assertIs(final SQLCaseAssertContext assertContext, final CleanMigrationStatement actual, final CleanMigrationStatementTestCase expected) {
if (null == expected) {
assertNull(assertContext.getText("Actual statement should not exist."), actual);
} else {
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/SQLParserTestCases.java b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/SQLParserTestCases.java
index 8180b91a871..daf9654fcbe 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/SQLParserTestCases.java
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/SQLParserTestCases.java
@@ -308,7 +308,7 @@ import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain
import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.UnlabelInstanceStatementTestCase;
import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.ApplyMigrationStatementTestCase;
import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.CheckMigrationStatementTestCase;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.DropMigrationStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.CleanMigrationStatementTestCase;
import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.MigrateTableStatementTestCase;
import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.ResetMigrationStatementTestCase;
import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.RestoreMigrationSourceWritingStatementTestCase;
@@ -1022,8 +1022,8 @@ public final class SQLParserTestCases {
@XmlElement(name = "reset-scaling")
private final List<ResetMigrationStatementTestCase> resetScalingTestCases = new LinkedList<>();
- @XmlElement(name = "drop-scaling")
- private final List<DropMigrationStatementTestCase> dropScalingTestCases = new LinkedList<>();
+ @XmlElement(name = "clean-scaling")
+ private final List<CleanMigrationStatementTestCase> cleanScalingTestCases = new LinkedList<>();
@XmlElement(name = "stop-scaling")
private final List<StopMigrationStatementTestCase> stopScalingTestCases = new LinkedList<>();
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/distsql/ral/migration/DropMigrationStatementTestCase.java b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/distsql/ral/migration/CleanMigrationStatementTestCase.java
similarity index 91%
rename from shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/distsql/ral/migration/DropMigrationStatementTestCase.java
rename to shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/distsql/ral/migration/CleanMigrationStatementTestCase.java
index 483957db40c..337e983d7b8 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/distsql/ral/migration/DropMigrationStatementTestCase.java
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/distsql/ral/migration/CleanMigrationStatementTestCase.java
@@ -25,10 +25,10 @@ import java.util.LinkedList;
import java.util.List;
/**
- * Drop migration statement test case.
+ * Clean migration statement test case.
*/
@Getter
-public final class DropMigrationStatementTestCase extends SQLParserTestCase {
+public final class CleanMigrationStatementTestCase extends SQLParserTestCase {
@XmlElement(name = "job-id")
private final List<String> jobIds = new LinkedList<>();
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ral/migration.xml b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ral/migration.xml
index b54a4edb1f1..e620dc9fed1 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ral/migration.xml
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ral/migration.xml
@@ -62,9 +62,9 @@
<job-id>123</job-id>
</apply-scaling>
- <drop-scaling sql-case-id="drop-scaling">
+ <clean-scaling sql-case-id="clean-scaling">
<job-id>123</job-id>
- </drop-scaling>
+ </clean-scaling>
<reset-scaling sql-case-id="reset-scaling">
<job-id>123</job-id>
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ral/migration.xml b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ral/migration.xml
index 4ac6e07623c..3511bb87c08 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ral/migration.xml
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ral/migration.xml
@@ -28,7 +28,7 @@
<distsql-case id="stop-scaling-source-writing" value="STOP SCALING SOURCE WRITING 123;" />
<distsql-case id="restore-scaling-source-writing" value="RESTORE SCALING SOURCE WRITING 123;" />
<distsql-case id="apply-scaling" value="APPLY SCALING 123;" />
- <distsql-case id="drop-scaling" value="DROP SCALING 123;" />
+ <distsql-case id="clean-scaling" value="CLEAN SCALING 123;" />
<distsql-case id="reset-scaling" value="RESET SCALING 123;" />
<distsql-case id="stop-scaling" value="STOP SCALING 123;" />
<distsql-case id="start-scaling" value="START SCALING 123;" />