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/10/23 15:49:39 UTC
[shardingsphere] branch master updated: For #21698, change `migration process configuration` to `migration rule`. (#21705)
This is an automated email from the ASF dual-hosted git repository.
zhangliang 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 967e9fae4f8 For #21698, change `migration process configuration` to `migration rule`. (#21705)
967e9fae4f8 is described below
commit 967e9fae4f8a435feea7aabca376826c227c9bde
Author: Raigor <ra...@gmail.com>
AuthorDate: Sun Oct 23 23:49:33 2022 +0800
For #21698, change `migration process configuration` to `migration rule`. (#21705)
* For #21698, change `migration process configuration` to `migration rule`.
* Remove parse test cases for `drop migration process configuration`
* Change case
* Update tag of xml.
* Fix migration it.
---
distsql/parser/src/main/antlr4/imports/Keyword.g4 | 4 --
.../parser/src/main/antlr4/imports/RALStatement.g4 | 18 ++-----
.../parser/autogen/KernelDistSQLStatement.g4 | 6 +--
.../core/kernel/KernelDistSQLStatementVisitor.java | 52 +++++++-------------
...t.java => InventoryIncrementalRuleSegment.java} | 4 +-
...tement.java => ShowMigrationRuleStatement.java} | 4 +-
...=> AlterInventoryIncrementalRuleStatement.java} | 8 ++--
...ryIncrementalProcessConfigurationStatement.java | 35 --------------
.../DropPipelineProcessConfigurationStatement.java | 34 -------------
.../shardingsphere-proxy/migration/build.cn.md | 55 ++++++++--------------
.../shardingsphere-proxy/migration/build.en.md | 55 ++++++++--------------
.../AbstractInventoryIncrementalJobAPIImpl.java | 7 +--
...t.java => ShowMigrationRuleQueryResultSet.java} | 8 ++--
...a => AlterInventoryIncrementalRuleUpdater.java} | 10 ++--
...toryIncrementalProcessConfigurationUpdater.java | 43 -----------------
.../DropPipelineProcessConfigurationUpdater.java | 40 ----------------
...mentalProcessConfigurationSegmentConverter.java | 4 +-
...dingsphere.infra.distsql.query.DistSQLResultSet | 2 +-
....shardingsphere.infra.distsql.update.RALUpdater | 4 +-
.../cases/migration/AbstractMigrationITCase.java | 2 +-
.../pipeline/command/MigrationDistSQLCommand.java | 4 +-
.../resources/env/common/migration-command.xml | 6 +--
.../UpdatableScalingRALStatementAssert.java | 8 +---
...ipelineProcessConfigurationStatementAssert.java | 42 -----------------
.../jaxb/cases/domain/SQLParserTestCases.java | 4 --
...elineProcessConfigurationStatementTestCase.java | 35 --------------
.../src/main/resources/case/ral/migration.xml | 8 ----
.../main/resources/sql/supported/ral/migration.xml | 2 -
28 files changed, 94 insertions(+), 410 deletions(-)
diff --git a/distsql/parser/src/main/antlr4/imports/Keyword.g4 b/distsql/parser/src/main/antlr4/imports/Keyword.g4
index 91377b58e16..395ae9c4cd2 100644
--- a/distsql/parser/src/main/antlr4/imports/Keyword.g4
+++ b/distsql/parser/src/main/antlr4/imports/Keyword.g4
@@ -279,10 +279,6 @@ MIGRATION
: M I G R A T I O N
;
-PROCESS
- : P R O C E S S
- ;
-
READ
: R E A D
;
diff --git a/distsql/parser/src/main/antlr4/imports/RALStatement.g4 b/distsql/parser/src/main/antlr4/imports/RALStatement.g4
index 6145ae3a514..08c4adc01b9 100644
--- a/distsql/parser/src/main/antlr4/imports/RALStatement.g4
+++ b/distsql/parser/src/main/antlr4/imports/RALStatement.g4
@@ -87,23 +87,15 @@ convertYamlConfiguration
: CONVERT YAML (CONFIGURATION | CONFIG) FILE EQ filePath
;
-showMigrationProcessConfiguration
- : SHOW MIGRATION PROCESS CONFIGURATION
+showMigrationRule
+ : SHOW MIGRATION RULE
;
-createMigrationProcessConfiguration
- : CREATE MIGRATION PROCESS CONFIGURATION inventoryIncrementalProcessConfiguration?
+alterMigrationRule
+ : ALTER MIGRATION RULE inventoryIncrementalRule?
;
-alterMigrationProcessConfiguration
- : ALTER MIGRATION PROCESS CONFIGURATION inventoryIncrementalProcessConfiguration?
- ;
-
-dropMigrationProcessConfiguration
- : DROP MIGRATION PROCESS CONFIGURATION confPath
- ;
-
-inventoryIncrementalProcessConfiguration
+inventoryIncrementalRule
: LP readDefinition? (COMMA? writeDefinition)? (COMMA? streamChannel)? RP
;
diff --git a/distsql/parser/src/main/antlr4/org/apache/shardingsphere/distsql/parser/autogen/KernelDistSQLStatement.g4 b/distsql/parser/src/main/antlr4/org/apache/shardingsphere/distsql/parser/autogen/KernelDistSQLStatement.g4
index 184ba7ad471..0f1131063b8 100644
--- a/distsql/parser/src/main/antlr4/org/apache/shardingsphere/distsql/parser/autogen/KernelDistSQLStatement.g4
+++ b/distsql/parser/src/main/antlr4/org/apache/shardingsphere/distsql/parser/autogen/KernelDistSQLStatement.g4
@@ -49,9 +49,7 @@ execute
| showRulesUsedResource
| importDatabaseConfiguration
| convertYamlConfiguration
- | showMigrationProcessConfiguration
- | createMigrationProcessConfiguration
- | alterMigrationProcessConfiguration
- | dropMigrationProcessConfiguration
+ | showMigrationRule
+ | alterMigrationRule
) SEMI?
;
diff --git a/distsql/parser/src/main/java/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementVisitor.java b/distsql/parser/src/main/java/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementVisitor.java
index 5c97786d4a3..e0ed515f876 100644
--- a/distsql/parser/src/main/java/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementVisitor.java
+++ b/distsql/parser/src/main/java/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementVisitor.java
@@ -19,17 +19,15 @@ package org.apache.shardingsphere.distsql.parser.core.kernel;
import org.antlr.v4.runtime.tree.ParseTree;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementBaseVisitor;
-import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.AlgorithmDefinitionContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.AlterComputeNodeContext;
-import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.AlterMigrationProcessConfigurationContext;
+import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.AlterMigrationRuleContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.AlterStorageUnitContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.ApplyDistSQLContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.BatchSizeContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.ClearHintContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.ConvertYamlConfigurationContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.CountSingleTableRuleContext;
-import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.CreateMigrationProcessConfigurationContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.DatabaseNameContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.DisableComputeNodeContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.DiscardDistSQLContext;
@@ -38,7 +36,7 @@ import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementPa
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.FromSegmentContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.ImportDatabaseConfigurationContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.InstanceIdContext;
-import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.InventoryIncrementalProcessConfigurationContext;
+import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.InventoryIncrementalRuleContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.LabelComputeNodeContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.PasswordContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.PrepareDistSQLContext;
@@ -51,27 +49,27 @@ import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementPa
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.SetDefaultSingleTableStorageUnitContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.SetDistVariableContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.ShardingSizeContext;
-import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.ShowDefaultSingleTableStorageUnitContext;
-import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.ShowDistVariableContext;
-import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.ShowDistVariablesContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.ShowComputeNodeInfoContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.ShowComputeNodeModeContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.ShowComputeNodesContext;
-import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.ShowMigrationProcessConfigurationContext;
+import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.ShowDefaultSingleTableStorageUnitContext;
+import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.ShowDistVariableContext;
+import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.ShowDistVariablesContext;
+import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.ShowMigrationRuleContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.ShowRulesUsedResourceContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.ShowSingleTableContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.ShowStorageUnitsContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.ShowTableMetadataContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.StorageUnitDefinitionContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.StreamChannelContext;
-import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.UnregisterStorageUnitContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.UnlabelComputeNodeContext;
+import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.UnregisterStorageUnitContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.WorkerThreadContext;
import org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.WriteDefinitionContext;
import org.apache.shardingsphere.distsql.parser.segment.AlgorithmSegment;
import org.apache.shardingsphere.distsql.parser.segment.DataSourceSegment;
import org.apache.shardingsphere.distsql.parser.segment.HostnameAndPortBasedDataSourceSegment;
-import org.apache.shardingsphere.distsql.parser.segment.InventoryIncrementalProcessConfigurationSegment;
+import org.apache.shardingsphere.distsql.parser.segment.InventoryIncrementalRuleSegment;
import org.apache.shardingsphere.distsql.parser.segment.ReadOrWriteSegment;
import org.apache.shardingsphere.distsql.parser.segment.URLBasedDataSourceSegment;
import org.apache.shardingsphere.distsql.parser.statement.ral.hint.ClearHintStatement;
@@ -81,15 +79,13 @@ import org.apache.shardingsphere.distsql.parser.statement.ral.queryable.ShowDist
import org.apache.shardingsphere.distsql.parser.statement.ral.queryable.ShowDistVariablesStatement;
import org.apache.shardingsphere.distsql.parser.statement.ral.queryable.ShowInstanceInfoStatement;
import org.apache.shardingsphere.distsql.parser.statement.ral.queryable.ShowInstanceListStatement;
-import org.apache.shardingsphere.distsql.parser.statement.ral.queryable.ShowMigrationProcessConfigurationStatement;
+import org.apache.shardingsphere.distsql.parser.statement.ral.queryable.ShowMigrationRuleStatement;
import org.apache.shardingsphere.distsql.parser.statement.ral.queryable.ShowModeInfoStatement;
import org.apache.shardingsphere.distsql.parser.statement.ral.queryable.ShowTableMetadataStatement;
import org.apache.shardingsphere.distsql.parser.statement.ral.updatable.AlterInstanceStatement;
-import org.apache.shardingsphere.distsql.parser.statement.ral.updatable.AlterInventoryIncrementalProcessConfigurationStatement;
+import org.apache.shardingsphere.distsql.parser.statement.ral.updatable.AlterInventoryIncrementalRuleStatement;
import org.apache.shardingsphere.distsql.parser.statement.ral.updatable.ApplyDistSQLStatement;
-import org.apache.shardingsphere.distsql.parser.statement.ral.updatable.CreateInventoryIncrementalProcessConfigurationStatement;
import org.apache.shardingsphere.distsql.parser.statement.ral.updatable.DiscardDistSQLStatement;
-import org.apache.shardingsphere.distsql.parser.statement.ral.updatable.DropPipelineProcessConfigurationStatement;
import org.apache.shardingsphere.distsql.parser.statement.ral.updatable.ImportDatabaseConfigurationStatement;
import org.apache.shardingsphere.distsql.parser.statement.ral.updatable.LabelInstanceStatement;
import org.apache.shardingsphere.distsql.parser.statement.ral.updatable.PrepareDistSQLStatement;
@@ -324,32 +320,20 @@ public final class KernelDistSQLStatementVisitor extends KernelDistSQLStatementB
}
@Override
- public ASTNode visitShowMigrationProcessConfiguration(final ShowMigrationProcessConfigurationContext ctx) {
- return new ShowMigrationProcessConfigurationStatement();
- }
-
- @Override
- public ASTNode visitCreateMigrationProcessConfiguration(final CreateMigrationProcessConfigurationContext ctx) {
- InventoryIncrementalProcessConfigurationSegment segment = null == ctx.inventoryIncrementalProcessConfiguration() ? null
- : (InventoryIncrementalProcessConfigurationSegment) visit(ctx.inventoryIncrementalProcessConfiguration());
- return new CreateInventoryIncrementalProcessConfigurationStatement("MIGRATION", segment);
- }
-
- @Override
- public ASTNode visitAlterMigrationProcessConfiguration(final AlterMigrationProcessConfigurationContext ctx) {
- InventoryIncrementalProcessConfigurationSegment segment = null == ctx.inventoryIncrementalProcessConfiguration() ? null
- : (InventoryIncrementalProcessConfigurationSegment) visit(ctx.inventoryIncrementalProcessConfiguration());
- return new AlterInventoryIncrementalProcessConfigurationStatement("MIGRATION", segment);
+ public ASTNode visitShowMigrationRule(final ShowMigrationRuleContext ctx) {
+ return new ShowMigrationRuleStatement();
}
@Override
- public ASTNode visitDropMigrationProcessConfiguration(final KernelDistSQLStatementParser.DropMigrationProcessConfigurationContext ctx) {
- return new DropPipelineProcessConfigurationStatement("MIGRATION", getIdentifierValue(ctx.confPath()));
+ public ASTNode visitAlterMigrationRule(final AlterMigrationRuleContext ctx) {
+ InventoryIncrementalRuleSegment segment = null == ctx.inventoryIncrementalRule() ? null
+ : (InventoryIncrementalRuleSegment) visit(ctx.inventoryIncrementalRule());
+ return new AlterInventoryIncrementalRuleStatement("MIGRATION", segment);
}
@Override
- public ASTNode visitInventoryIncrementalProcessConfiguration(final InventoryIncrementalProcessConfigurationContext ctx) {
- InventoryIncrementalProcessConfigurationSegment result = new InventoryIncrementalProcessConfigurationSegment();
+ public ASTNode visitInventoryIncrementalRule(final InventoryIncrementalRuleContext ctx) {
+ InventoryIncrementalRuleSegment result = new InventoryIncrementalRuleSegment();
if (null != ctx.readDefinition()) {
result.setReadSegment((ReadOrWriteSegment) visit(ctx.readDefinition()));
}
diff --git a/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/segment/InventoryIncrementalProcessConfigurationSegment.java b/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/segment/InventoryIncrementalRuleSegment.java
similarity index 88%
rename from distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/segment/InventoryIncrementalProcessConfigurationSegment.java
rename to distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/segment/InventoryIncrementalRuleSegment.java
index b3a08995ff6..cef9647400d 100644
--- a/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/segment/InventoryIncrementalProcessConfigurationSegment.java
+++ b/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/segment/InventoryIncrementalRuleSegment.java
@@ -22,11 +22,11 @@ import lombok.Setter;
import org.apache.shardingsphere.sql.parser.api.visitor.ASTNode;
/**
- * Inventory incremental process configuration segment.
+ * Inventory incremental rule segment.
*/
@Getter
@Setter
-public final class InventoryIncrementalProcessConfigurationSegment implements ASTNode {
+public final class InventoryIncrementalRuleSegment implements ASTNode {
private ReadOrWriteSegment readSegment;
diff --git a/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/statement/ral/queryable/ShowMigrationProcessConfigurationStatement.java b/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/statement/ral/queryable/ShowMigrationRuleStatement.java
similarity index 86%
rename from distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/statement/ral/queryable/ShowMigrationProcessConfigurationStatement.java
rename to distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/statement/ral/queryable/ShowMigrationRuleStatement.java
index 8cffebac261..427771b780f 100644
--- a/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/statement/ral/queryable/ShowMigrationProcessConfigurationStatement.java
+++ b/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/statement/ral/queryable/ShowMigrationRuleStatement.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.distsql.parser.statement.ral.queryable;
import org.apache.shardingsphere.distsql.parser.statement.ral.scaling.QueryableScalingRALStatement;
/**
- * Show migration process configuration statement.
+ * Show migration rule statement.
*/
-public final class ShowMigrationProcessConfigurationStatement extends QueryableScalingRALStatement {
+public final class ShowMigrationRuleStatement extends QueryableScalingRALStatement {
}
diff --git a/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/statement/ral/updatable/AlterInventoryIncrementalProcessConfigurationStatement.java b/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/statement/ral/updatable/AlterInventoryIncrementalRuleStatement.java
similarity index 79%
rename from distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/statement/ral/updatable/AlterInventoryIncrementalProcessConfigurationStatement.java
rename to distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/statement/ral/updatable/AlterInventoryIncrementalRuleStatement.java
index 275b8b8e288..a9457e957eb 100644
--- a/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/statement/ral/updatable/AlterInventoryIncrementalProcessConfigurationStatement.java
+++ b/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/statement/ral/updatable/AlterInventoryIncrementalRuleStatement.java
@@ -19,17 +19,17 @@ package org.apache.shardingsphere.distsql.parser.statement.ral.updatable;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.distsql.parser.segment.InventoryIncrementalProcessConfigurationSegment;
+import org.apache.shardingsphere.distsql.parser.segment.InventoryIncrementalRuleSegment;
import org.apache.shardingsphere.distsql.parser.statement.ral.scaling.UpdatableScalingRALStatement;
/**
- * Alter inventory incremental process configuration statement.
+ * Alter inventory incremental rule statement.
*/
@RequiredArgsConstructor
@Getter
-public final class AlterInventoryIncrementalProcessConfigurationStatement extends UpdatableScalingRALStatement {
+public final class AlterInventoryIncrementalRuleStatement extends UpdatableScalingRALStatement {
private final String jobTypeName;
- private final InventoryIncrementalProcessConfigurationSegment processConfigSegment;
+ private final InventoryIncrementalRuleSegment processConfigSegment;
}
diff --git a/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/statement/ral/updatable/CreateInventoryIncrementalProcessConfigurationStatement.java b/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/statement/ral/updatable/CreateInventoryIncrementalProcessConfigurationStatement.java
deleted file mode 100644
index ecf4f3235bd..00000000000
--- a/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/statement/ral/updatable/CreateInventoryIncrementalProcessConfigurationStatement.java
+++ /dev/null
@@ -1,35 +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.
- */
-
-package org.apache.shardingsphere.distsql.parser.statement.ral.updatable;
-
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.distsql.parser.segment.InventoryIncrementalProcessConfigurationSegment;
-import org.apache.shardingsphere.distsql.parser.statement.ral.scaling.UpdatableScalingRALStatement;
-
-/**
- * Create inventory incremental process configuration statement.
- */
-@RequiredArgsConstructor
-@Getter
-public final class CreateInventoryIncrementalProcessConfigurationStatement extends UpdatableScalingRALStatement {
-
- private final String jobTypeName;
-
- private final InventoryIncrementalProcessConfigurationSegment processConfigSegment;
-}
diff --git a/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/statement/ral/updatable/DropPipelineProcessConfigurationStatement.java b/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/statement/ral/updatable/DropPipelineProcessConfigurationStatement.java
deleted file mode 100644
index 32a979fa233..00000000000
--- a/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/parser/statement/ral/updatable/DropPipelineProcessConfigurationStatement.java
+++ /dev/null
@@ -1,34 +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.
- */
-
-package org.apache.shardingsphere.distsql.parser.statement.ral.updatable;
-
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.distsql.parser.statement.ral.scaling.UpdatableScalingRALStatement;
-
-/**
- * Drop pipeline process configuration statement.
- */
-@RequiredArgsConstructor
-@Getter
-public final class DropPipelineProcessConfigurationStatement extends UpdatableScalingRALStatement {
-
- private final String jobTypeName;
-
- private final String confPath;
-}
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/migration/build.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/migration/build.cn.md
index 0346843cc09..d94255052f1 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/migration/build.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/migration/build.cn.md
@@ -80,7 +80,7 @@ sh bin/start.sh
7.1. 查询配置。
```sql
-SHOW MIGRATION PROCESS CONFIGURATION;
+SHOW MIGRATION RULE;
```
默认配置如下:
@@ -93,14 +93,14 @@ SHOW MIGRATION PROCESS CONFIGURATION;
+--------------------------------------------------------------+--------------------------------------+------------------------------------------------------+
```
-7.2. 新建配置(可选)。
+7.2. 修改配置(可选)。
-不配置的话有默认值。
+因 migration rule 具有默认值,无需创建,仅提供 ALTER 语句。
完整配置 DistSQL 示例:
```sql
-CREATE MIGRATION PROCESS CONFIGURATION (
+ALTER MIGRATION RULE (
READ(
WORKER_THREAD=40,
BATCH_SIZE=1000,
@@ -119,7 +119,7 @@ STREAM_CHANNEL (TYPE(NAME='MEMORY',PROPERTIES('block-queue-size'='10000')))
配置项说明:
```sql
-CREATE MIGRATION PROCESS CONFIGURATION (
+ALTER MIGRATION RULE (
READ( -- 数据读取配置。如果不配置则部分参数默认生效。
WORKER_THREAD=40, -- 从源端摄取全量数据的线程池大小。如果不配置则使用默认值。
BATCH_SIZE=1000, -- 一次查询操作返回的最大记录数。如果不配置则使用默认值。
@@ -153,7 +153,7 @@ PROPERTIES( -- 算法属性
DistSQL 示例:配置 `READ` 限流。
```sql
-CREATE MIGRATION PROCESS CONFIGURATION (
+ALTER MIGRATION RULE (
READ(
RATE_LIMITER (TYPE(NAME='QPS',PROPERTIES('qps'='500')))
)
@@ -162,38 +162,23 @@ READ(
配置读取数据限流,其它配置使用默认值。
-7.3. 修改配置。
+7.3. 恢复配置。
-`ALTER MIGRATION PROCESS CONFIGURATION`,内部结构和 `CREATE MIGRATION PROCESS CONFIGURATION` 一致。
-
-DistSQL 示例:调整限流参数
+如需恢复默认配置,也通过 ALTER 语句进行操作。
```sql
-ALTER MIGRATION PROCESS CONFIGURATION (
-READ(
- RATE_LIMITER (TYPE(NAME='QPS',PROPERTIES('qps'='1000')))
-)
-);
----
-ALTER MIGRATION PROCESS CONFIGURATION (
+ALTER MIGRATION RULE (
READ(
- RATE_LIMITER (TYPE(NAME='QPS',PROPERTIES('qps'='1000')))
-), WRITE(
- RATE_LIMITER (TYPE(NAME='TPS',PROPERTIES('tps'='1000')))
-)
+ WORKER_THREAD=40,
+ BATCH_SIZE=1000,
+ SHARDING_SIZE=10000000,
+ RATE_LIMITER (TYPE(NAME='QPS',PROPERTIES('qps'='500')))
+),
+WRITE(
+ WORKER_THREAD=40,
+ BATCH_SIZE=1000,
+ RATE_LIMITER (TYPE(NAME='TPS',PROPERTIES('tps'='2000')))
+),
+STREAM_CHANNEL (TYPE(NAME='MEMORY',PROPERTIES('block-queue-size'='10000')))
);
```
-
-7.4. 清除配置。
-
-DistSQL 示例:清空 `READ` 配置、恢复为默认值。
-
-```sql
-DROP MIGRATION PROCESS CONFIGURATION '/READ';
-```
-
-DistSQL 示例:清空 `READ/RATE_LIMITER` 配置。
-
-```sql
-DROP MIGRATION PROCESS CONFIGURATION '/READ/RATE_LIMITER';
-```
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/migration/build.en.md b/docs/document/content/user-manual/shardingsphere-proxy/migration/build.en.md
index aec7f7d7322..9cdad83a666 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/migration/build.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/migration/build.en.md
@@ -80,7 +80,7 @@ The startup will have been successful.
7.1. Query configuration.
```sql
-SHOW MIGRATION PROCESS CONFIGURATION;
+SHOW MIGRATION RULE;
```
The default configuration is as follows.
@@ -93,14 +93,14 @@ The default configuration is as follows.
+--------------------------------------------------------------+--------------------------------------+------------------------------------------------------+
```
-7.2. New configuration (Optional).
+7.2. Alter configuration (Optional).
-A default value is available if there is no configuration.
+Since the migration rule has default values, there is no need to create it, only the `ALTER` statement is provided.
A completely configured DistSQL is as follows.
```sql
-CREATE MIGRATION PROCESS CONFIGURATION (
+ALTER MIGRATION RULE (
READ(
WORKER_THREAD=40,
BATCH_SIZE=1000,
@@ -119,7 +119,7 @@ STREAM_CHANNEL (TYPE(NAME='MEMORY',PROPERTIES('block-queue-size'='10000')))
Configuration item description:
```sql
-CREATE MIGRATION PROCESS CONFIGURATION (
+ALTER MIGRATION RULE (
READ( -- Data reading configuration. If it is not configured, part of the parameters will take effect by default.
WORKER_THREAD=40, -- Obtain the thread pool size of all the data from the source side. If it is not configured, the default value is used.
BATCH_SIZE=1000, -- The maximum number of records returned by a query operation. If it is not configured, the default value is used.
@@ -153,7 +153,7 @@ PROPERTIES( -- Algorithm property
DistSQL sample: configure `READ` for traffic limit.
```sql
-CREATE MIGRATION PROCESS CONFIGURATION (
+ALTER MIGRATION RULE (
READ(
RATE_LIMITER (TYPE(NAME='QPS',PROPERTIES('qps'='500')))
)
@@ -162,38 +162,23 @@ READ(
Configure data reading for traffic limit. Other configurations use default values.
-7.3. Modify configuration.
+7.3. Restore configuration.
-`ALTER MIGRATION PROCESS CONFIGURATION`, and its internal structure is the same as that of `CREATE MIGRATION PROCESS CONFIGURATION`.
-
-DistSQL sample: modify traffic limit parameter
+To restore the default configuration, also through the `ALTER` statement.
```sql
-ALTER MIGRATION PROCESS CONFIGURATION (
-READ(
- RATE_LIMITER (TYPE(NAME='QPS',PROPERTIES('qps'='1000')))
-)
-);
----
-ALTER MIGRATION PROCESS CONFIGURATION (
+ALTER MIGRATION RULE (
READ(
- RATE_LIMITER (TYPE(NAME='QPS',PROPERTIES('qps'='1000')))
-), WRITE(
- RATE_LIMITER (TYPE(NAME='TPS',PROPERTIES('tps'='1000')))
-)
+ WORKER_THREAD=40,
+ BATCH_SIZE=1000,
+ SHARDING_SIZE=10000000,
+ RATE_LIMITER (TYPE(NAME='QPS',PROPERTIES('qps'='500')))
+),
+WRITE(
+ WORKER_THREAD=40,
+ BATCH_SIZE=1000,
+ RATE_LIMITER (TYPE(NAME='TPS',PROPERTIES('tps'='2000')))
+),
+STREAM_CHANNEL (TYPE(NAME='MEMORY',PROPERTIES('block-queue-size'='10000')))
);
```
-
-7.4. Clear configuration.
-
-DistSQL sample: clear the configuration of `READ` and restore it to the default value.
-
-```sql
-DROP MIGRATION PROCESS CONFIGURATION '/READ';
-```
-
-DistSQL sample: clear the configuration of `READ/RATE_LIMITER`.
-
-```sql
-DROP MIGRATION PROCESS CONFIGURATION '/READ/RATE_LIMITER';
-```
diff --git a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/api/impl/AbstractInventoryIncrementalJobAPIImpl.java b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/api/impl/AbstractInventoryIncrementalJobAPIImpl.java
index 55e0e245383..55e3ffafea9 100644
--- a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/api/impl/AbstractInventoryIncrementalJobAPIImpl.java
+++ b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/api/impl/AbstractInventoryIncrementalJobAPIImpl.java
@@ -32,7 +32,6 @@ import org.apache.shardingsphere.data.pipeline.core.check.consistency.DataConsis
import org.apache.shardingsphere.data.pipeline.core.config.process.PipelineProcessConfigurationUtil;
import org.apache.shardingsphere.data.pipeline.core.context.InventoryIncrementalProcessContext;
import org.apache.shardingsphere.data.pipeline.core.exception.metadata.AlterNotExistProcessConfigurationException;
-import org.apache.shardingsphere.data.pipeline.core.exception.metadata.CreateExistsProcessConfigurationException;
import org.apache.shardingsphere.data.pipeline.scenario.consistencycheck.ConsistencyCheckJobItemContext;
import org.apache.shardingsphere.data.pipeline.spi.check.consistency.DataConsistencyCalculateAlgorithm;
import org.apache.shardingsphere.data.pipeline.spi.check.consistency.DataConsistencyCalculateAlgorithmFactory;
@@ -69,17 +68,13 @@ public abstract class AbstractInventoryIncrementalJobAPIImpl extends AbstractPip
@Override
public void createProcessConfiguration(final PipelineProcessConfiguration processConfig) {
- PipelineProcessConfiguration existingProcessConfig = processConfigPersistService.load(getJobType());
- ShardingSpherePreconditions.checkState(null == existingProcessConfig, CreateExistsProcessConfigurationException::new);
processConfigPersistService.persist(getJobType(), processConfig);
}
@Override
public void alterProcessConfiguration(final PipelineProcessConfiguration processConfig) {
// TODO check rateLimiter type match or not
- YamlPipelineProcessConfiguration targetYamlProcessConfig = getTargetYamlProcessConfiguration();
- targetYamlProcessConfig.copyNonNullFields(swapper.swapToYamlConfiguration(processConfig));
- processConfigPersistService.persist(getJobType(), swapper.swapToObject(targetYamlProcessConfig));
+ processConfigPersistService.persist(getJobType(), processConfig);
}
private YamlPipelineProcessConfiguration getTargetYamlProcessConfiguration() {
diff --git a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowMigrationProcessConfigurationQueryResultSet.java b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowMigrationRuleQueryResultSet.java
similarity index 90%
rename from proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowMigrationProcessConfigurationQueryResultSet.java
rename to proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowMigrationRuleQueryResultSet.java
index b123b2fdf68..7adb1184ca5 100644
--- a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowMigrationProcessConfigurationQueryResultSet.java
+++ b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowMigrationRuleQueryResultSet.java
@@ -21,7 +21,7 @@ import com.google.gson.Gson;
import org.apache.shardingsphere.data.pipeline.api.MigrationJobPublicAPI;
import org.apache.shardingsphere.data.pipeline.api.PipelineJobPublicAPIFactory;
import org.apache.shardingsphere.data.pipeline.api.config.process.PipelineProcessConfiguration;
-import org.apache.shardingsphere.distsql.parser.statement.ral.queryable.ShowMigrationProcessConfigurationStatement;
+import org.apache.shardingsphere.distsql.parser.statement.ral.queryable.ShowMigrationRuleStatement;
import org.apache.shardingsphere.infra.distsql.query.DatabaseDistSQLResultSet;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement;
@@ -33,9 +33,9 @@ import java.util.Iterator;
import java.util.LinkedList;
/**
- * Show migration process configuration query result set.
+ * Show migration rule query result set.
*/
-public final class ShowMigrationProcessConfigurationQueryResultSet implements DatabaseDistSQLResultSet {
+public final class ShowMigrationRuleQueryResultSet implements DatabaseDistSQLResultSet {
private static final MigrationJobPublicAPI JOB_API = PipelineJobPublicAPIFactory.getMigrationJobPublicAPI();
@@ -74,6 +74,6 @@ public final class ShowMigrationProcessConfigurationQueryResultSet implements Da
@Override
public String getType() {
- return ShowMigrationProcessConfigurationStatement.class.getName();
+ return ShowMigrationRuleStatement.class.getName();
}
}
diff --git a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/AlterInventoryIncrementalProcessConfigurationUpdater.java b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/AlterInventoryIncrementalRuleUpdater.java
similarity index 81%
rename from proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/AlterInventoryIncrementalProcessConfigurationUpdater.java
rename to proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/AlterInventoryIncrementalRuleUpdater.java
index cdbe647657c..75852ae4c80 100644
--- a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/AlterInventoryIncrementalProcessConfigurationUpdater.java
+++ b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/AlterInventoryIncrementalRuleUpdater.java
@@ -20,17 +20,17 @@ package org.apache.shardingsphere.proxy.backend.handler.distsql.ral.updatable;
import org.apache.shardingsphere.data.pipeline.api.InventoryIncrementalJobPublicAPI;
import org.apache.shardingsphere.data.pipeline.api.PipelineJobPublicAPIFactory;
import org.apache.shardingsphere.data.pipeline.api.config.process.PipelineProcessConfiguration;
-import org.apache.shardingsphere.distsql.parser.statement.ral.updatable.AlterInventoryIncrementalProcessConfigurationStatement;
+import org.apache.shardingsphere.distsql.parser.statement.ral.updatable.AlterInventoryIncrementalRuleStatement;
import org.apache.shardingsphere.infra.distsql.update.RALUpdater;
import org.apache.shardingsphere.proxy.backend.handler.distsql.ral.updatable.converter.InventoryIncrementalProcessConfigurationSegmentConverter;
/**
- * Alter inventory incremental process configuration updater.
+ * Alter inventory incremental rule updater.
*/
-public final class AlterInventoryIncrementalProcessConfigurationUpdater implements RALUpdater<AlterInventoryIncrementalProcessConfigurationStatement> {
+public final class AlterInventoryIncrementalRuleUpdater implements RALUpdater<AlterInventoryIncrementalRuleStatement> {
@Override
- public void executeUpdate(final String databaseName, final AlterInventoryIncrementalProcessConfigurationStatement sqlStatement) {
+ public void executeUpdate(final String databaseName, final AlterInventoryIncrementalRuleStatement sqlStatement) {
InventoryIncrementalJobPublicAPI jobAPI = PipelineJobPublicAPIFactory.getInventoryIncrementalJobPublicAPI(sqlStatement.getJobTypeName());
PipelineProcessConfiguration processConfig = InventoryIncrementalProcessConfigurationSegmentConverter.convert(sqlStatement.getProcessConfigSegment());
jobAPI.alterProcessConfiguration(processConfig);
@@ -38,6 +38,6 @@ public final class AlterInventoryIncrementalProcessConfigurationUpdater implemen
@Override
public String getType() {
- return AlterInventoryIncrementalProcessConfigurationStatement.class.getName();
+ return AlterInventoryIncrementalRuleStatement.class.getName();
}
}
diff --git a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/CreateInventoryIncrementalProcessConfigurationUpdater.java b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/CreateInventoryIncrementalProcessConfigurationUpdater.java
deleted file mode 100644
index 2fab9c8c6c3..00000000000
--- a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/CreateInventoryIncrementalProcessConfigurationUpdater.java
+++ /dev/null
@@ -1,43 +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.
- */
-
-package org.apache.shardingsphere.proxy.backend.handler.distsql.ral.updatable;
-
-import org.apache.shardingsphere.data.pipeline.api.InventoryIncrementalJobPublicAPI;
-import org.apache.shardingsphere.data.pipeline.api.PipelineJobPublicAPIFactory;
-import org.apache.shardingsphere.data.pipeline.api.config.process.PipelineProcessConfiguration;
-import org.apache.shardingsphere.distsql.parser.statement.ral.updatable.CreateInventoryIncrementalProcessConfigurationStatement;
-import org.apache.shardingsphere.infra.distsql.update.RALUpdater;
-import org.apache.shardingsphere.proxy.backend.handler.distsql.ral.updatable.converter.InventoryIncrementalProcessConfigurationSegmentConverter;
-
-/**
- * Create inventory incremental process configuration updater.
- */
-public final class CreateInventoryIncrementalProcessConfigurationUpdater implements RALUpdater<CreateInventoryIncrementalProcessConfigurationStatement> {
-
- @Override
- public void executeUpdate(final String databaseName, final CreateInventoryIncrementalProcessConfigurationStatement sqlStatement) {
- InventoryIncrementalJobPublicAPI jobAPI = PipelineJobPublicAPIFactory.getInventoryIncrementalJobPublicAPI(sqlStatement.getJobTypeName());
- PipelineProcessConfiguration processConfig = InventoryIncrementalProcessConfigurationSegmentConverter.convert(sqlStatement.getProcessConfigSegment());
- jobAPI.createProcessConfiguration(processConfig);
- }
-
- @Override
- public String getType() {
- return CreateInventoryIncrementalProcessConfigurationStatement.class.getName();
- }
-}
diff --git a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/DropPipelineProcessConfigurationUpdater.java b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/DropPipelineProcessConfigurationUpdater.java
deleted file mode 100644
index d550b456268..00000000000
--- a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/DropPipelineProcessConfigurationUpdater.java
+++ /dev/null
@@ -1,40 +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.
- */
-
-package org.apache.shardingsphere.proxy.backend.handler.distsql.ral.updatable;
-
-import org.apache.shardingsphere.data.pipeline.api.InventoryIncrementalJobPublicAPI;
-import org.apache.shardingsphere.data.pipeline.api.PipelineJobPublicAPIFactory;
-import org.apache.shardingsphere.distsql.parser.statement.ral.updatable.DropPipelineProcessConfigurationStatement;
-import org.apache.shardingsphere.infra.distsql.update.RALUpdater;
-
-/**
- * Drop pipeline process configuration updater.
- */
-public final class DropPipelineProcessConfigurationUpdater implements RALUpdater<DropPipelineProcessConfigurationStatement> {
-
- @Override
- public void executeUpdate(final String databaseName, final DropPipelineProcessConfigurationStatement sqlStatement) {
- InventoryIncrementalJobPublicAPI jobAPI = PipelineJobPublicAPIFactory.getInventoryIncrementalJobPublicAPI(sqlStatement.getJobTypeName());
- jobAPI.dropProcessConfiguration(sqlStatement.getConfPath());
- }
-
- @Override
- public String getType() {
- return DropPipelineProcessConfigurationStatement.class.getName();
- }
-}
diff --git a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/converter/InventoryIncrementalProcessConfigurationSegmentConverter.java b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/converter/InventoryIncrementalProcessConfigurationSegmentConverter.java
index 9ca313c150a..115ef4b4b3e 100644
--- a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/converter/InventoryIncrementalProcessConfigurationSegmentConverter.java
+++ b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/converter/InventoryIncrementalProcessConfigurationSegmentConverter.java
@@ -23,7 +23,7 @@ import org.apache.shardingsphere.data.pipeline.api.config.process.PipelineProces
import org.apache.shardingsphere.data.pipeline.api.config.process.PipelineReadConfiguration;
import org.apache.shardingsphere.data.pipeline.api.config.process.PipelineWriteConfiguration;
import org.apache.shardingsphere.distsql.parser.segment.AlgorithmSegment;
-import org.apache.shardingsphere.distsql.parser.segment.InventoryIncrementalProcessConfigurationSegment;
+import org.apache.shardingsphere.distsql.parser.segment.InventoryIncrementalRuleSegment;
import org.apache.shardingsphere.distsql.parser.segment.ReadOrWriteSegment;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
@@ -39,7 +39,7 @@ public final class InventoryIncrementalProcessConfigurationSegmentConverter {
* @param segment process configuration segment
* @return pipeline process configuration
*/
- public static PipelineProcessConfiguration convert(final InventoryIncrementalProcessConfigurationSegment segment) {
+ public static PipelineProcessConfiguration convert(final InventoryIncrementalRuleSegment segment) {
PipelineReadConfiguration readConfig = convertToReadConfiguration(segment.getReadSegment());
PipelineWriteConfiguration writeConfig = convertToWriteConfiguration(segment.getWriteSegment());
AlgorithmConfiguration streamChannel = convertToAlgorithm(segment.getStreamChannel());
diff --git a/proxy/backend/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.distsql.query.DistSQLResultSet b/proxy/backend/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.distsql.query.DistSQLResultSet
index 21896799843..dce6e744121 100644
--- a/proxy/backend/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.distsql.query.DistSQLResultSet
+++ b/proxy/backend/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.distsql.query.DistSQLResultSet
@@ -21,4 +21,4 @@ org.apache.shardingsphere.proxy.backend.handler.distsql.rql.rule.SingleTableQuer
org.apache.shardingsphere.proxy.backend.handler.distsql.rql.rule.SingleTableRulesQueryResultSet
org.apache.shardingsphere.proxy.backend.handler.distsql.rql.rule.RulesUsedResourceQueryResultSet
org.apache.shardingsphere.proxy.backend.handler.distsql.rql.rule.CountSingleTableRuleQueryResultSet
-org.apache.shardingsphere.proxy.backend.handler.distsql.ral.queryable.ShowMigrationProcessConfigurationQueryResultSet
+org.apache.shardingsphere.proxy.backend.handler.distsql.ral.queryable.ShowMigrationRuleQueryResultSet
diff --git a/proxy/backend/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.distsql.update.RALUpdater b/proxy/backend/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.distsql.update.RALUpdater
index c03fcc4e826..2d26c849b1a 100644
--- a/proxy/backend/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.distsql.update.RALUpdater
+++ b/proxy/backend/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.distsql.update.RALUpdater
@@ -15,6 +15,4 @@
# limitations under the License.
#
-org.apache.shardingsphere.proxy.backend.handler.distsql.ral.updatable.CreateInventoryIncrementalProcessConfigurationUpdater
-org.apache.shardingsphere.proxy.backend.handler.distsql.ral.updatable.AlterInventoryIncrementalProcessConfigurationUpdater
-org.apache.shardingsphere.proxy.backend.handler.distsql.ral.updatable.DropPipelineProcessConfigurationUpdater
+org.apache.shardingsphere.proxy.backend.handler.distsql.ral.updatable.AlterInventoryIncrementalRuleUpdater
diff --git a/test/integration-test/scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/migration/AbstractMigrationITCase.java b/test/integration-test/scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/migration/AbstractMigrationITCase.java
index 59aa10f91d0..73fd6437b69 100644
--- a/test/integration-test/scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/migration/AbstractMigrationITCase.java
+++ b/test/integration-test/scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/migration/AbstractMigrationITCase.java
@@ -138,7 +138,7 @@ public abstract class AbstractMigrationITCase extends BaseITCase {
log.warn("Drop migration process configuration failed, maybe it's not exist. error msg={}", ex.getMessage());
}
}
- proxyExecuteWithLog(migrationDistSQLCommand.getAddMigrationProcessConfig(), 0);
+ proxyExecuteWithLog(migrationDistSQLCommand.getAlterMigrationRule(), 0);
}
protected void stopMigrationByJobId(final String jobId) throws SQLException {
diff --git a/test/integration-test/scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/command/MigrationDistSQLCommand.java b/test/integration-test/scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/command/MigrationDistSQLCommand.java
index 009aaa9de15..11c4b1ea578 100644
--- a/test/integration-test/scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/command/MigrationDistSQLCommand.java
+++ b/test/integration-test/scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/command/MigrationDistSQLCommand.java
@@ -30,9 +30,9 @@ import javax.xml.bind.annotation.XmlRootElement;
@XmlAccessorType(XmlAccessType.FIELD)
public final class MigrationDistSQLCommand {
- @XmlElement(name = "add-migration-process-config")
+ @XmlElement(name = "alter-migration-rule")
@Getter
- private String addMigrationProcessConfig;
+ private String alterMigrationRule;
@XmlElement(name = "create-target-order-table-encrypt-rule")
@Getter
diff --git a/test/integration-test/scaling/src/test/resources/env/common/migration-command.xml b/test/integration-test/scaling/src/test/resources/env/common/migration-command.xml
index 69a4fe6a207..382ea8adb5e 100644
--- a/test/integration-test/scaling/src/test/resources/env/common/migration-command.xml
+++ b/test/integration-test/scaling/src/test/resources/env/common/migration-command.xml
@@ -16,8 +16,8 @@
-->
<command>
- <add-migration-process-config>
- CREATE MIGRATION PROCESS CONFIGURATION (
+ <alter-migration-rule>
+ ALTER MIGRATION RULE (
READ(
WORKER_THREAD=40,
BATCH_SIZE=1000,
@@ -31,7 +31,7 @@
),
STREAM_CHANNEL (TYPE(NAME='MEMORY',PROPERTIES('block-queue-size'='10000')))
);
- </add-migration-process-config>
+ </alter-migration-rule>
<add-migration-source-resource-template>
ADD MIGRATION SOURCE RESOURCE ds_0 (
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/ral/impl/migration/UpdatableScalingRALStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/ral/impl/migration/UpdatableScalingRALStatementAssert.java
index e1dd898baad..87b6167a804 100644
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/ral/impl/migration/UpdatableScalingRALStatementAssert.java
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/ral/impl/migration/UpdatableScalingRALStatementAssert.java
@@ -20,7 +20,6 @@ package org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statemen
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.shardingsphere.distsql.parser.statement.ral.scaling.UpdatableScalingRALStatement;
-import org.apache.shardingsphere.distsql.parser.statement.ral.updatable.DropPipelineProcessConfigurationStatement;
import org.apache.shardingsphere.migration.distsql.statement.AddMigrationSourceResourceStatement;
import org.apache.shardingsphere.migration.distsql.statement.CheckMigrationStatement;
import org.apache.shardingsphere.migration.distsql.statement.CommitMigrationStatement;
@@ -30,11 +29,10 @@ import org.apache.shardingsphere.migration.distsql.statement.RollbackMigrationSt
import org.apache.shardingsphere.migration.distsql.statement.StartMigrationStatement;
import org.apache.shardingsphere.migration.distsql.statement.StopMigrationStatement;
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.CheckMigrationStatementAssert;
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.CheckMigrationStatementAssert;
import org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.ral.impl.migration.update.CommitMigrationStatementAssert;
import org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.ral.impl.migration.update.DropMigrationSourceResourceStatementAssert;
-import org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.ral.impl.migration.update.DropPipelineProcessConfigurationStatementAssert;
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.RollbackMigrationStatementAssert;
import org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.ral.impl.migration.update.StartMigrationStatementAssert;
@@ -44,7 +42,6 @@ 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.CheckMigrationStatementTestCase;
import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.CommitMigrationStatementTestCase;
import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.DropMigrationSourceResourceStatementTestCase;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.DropPipelineProcessConfigurationStatementTestCase;
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.RollbackMigrationStatementTestCase;
import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.StartMigrationStatementTestCase;
@@ -67,9 +64,6 @@ public final class UpdatableScalingRALStatementAssert {
// TODO add more test case
if (actual instanceof MigrateTableStatement) {
MigrateTableStatementAssert.assertIs(assertContext, (MigrateTableStatement) actual, (MigrateTableStatementTestCase) expected);
- } else if (actual instanceof DropPipelineProcessConfigurationStatement) {
- DropPipelineProcessConfigurationStatementAssert.assertIs(assertContext, (DropPipelineProcessConfigurationStatement) actual,
- (DropPipelineProcessConfigurationStatementTestCase) expected);
} else if (actual instanceof StopMigrationStatement) {
StopMigrationStatementAssert.assertIs(assertContext, (StopMigrationStatement) actual, (StopMigrationStatementTestCase) expected);
} else if (actual instanceof CommitMigrationStatement) {
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/ral/impl/migration/update/DropPipelineProcessConfigurationStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/ral/impl/migration/update/DropPipelineProcessConfigurationStatementAssert.java
deleted file mode 100644
index c8497491d3b..00000000000
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/ral/impl/migration/update/DropPipelineProcessConfigurationStatementAssert.java
+++ /dev/null
@@ -1,42 +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.
- */
-
-package org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.ral.impl.migration.update;
-
-import org.apache.shardingsphere.distsql.parser.statement.ral.updatable.DropPipelineProcessConfigurationStatement;
-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.DropPipelineProcessConfigurationStatementTestCase;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-/**
- * Drop pipeline process configuration statement assert.
- */
-public final class DropPipelineProcessConfigurationStatementAssert {
-
- /**
- * Assert drop pipeline process configuration statement is correct with expected parser result.
- *
- * @param assertContext assert context
- * @param actual actual statement
- * @param expected expected statement test case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext, final DropPipelineProcessConfigurationStatement actual, final DropPipelineProcessConfigurationStatementTestCase expected) {
- assertThat(assertContext.getText("conf path does not match"), actual.getConfPath(), is(expected.getConfPath()));
- }
-}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/SQLParserTestCases.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/SQLParserTestCases.java
index db33a5e6c10..2f23d302e99 100644
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/SQLParserTestCases.java
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/SQLParserTestCases.java
@@ -318,7 +318,6 @@ 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.CheckMigrationStatementTestCase;
import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.CommitMigrationStatementTestCase;
import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.DropMigrationSourceResourceStatementTestCase;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.DropPipelineProcessConfigurationStatementTestCase;
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.RollbackMigrationStatementTestCase;
import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration.ShowMigrationCheckAlgorithmsStatementTestCase;
@@ -1032,9 +1031,6 @@ public final class SQLParserTestCases {
@XmlElement(name = "start-migration")
private final List<StartMigrationStatementTestCase> startMigrationTestCases = new LinkedList<>();
- @XmlElement(name = "drop-migration-process-configuration")
- private final List<DropPipelineProcessConfigurationStatementTestCase> dropMigrationProcessConfigurationStatementTestCases = new LinkedList<>();
-
@XmlElement(name = "migrate-table")
private final List<MigrateTableStatementTestCase> migrateTableTestCases = new LinkedList<>();
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/distsql/ral/migration/DropPipelineProcessConfigurationStatementTestCase.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/distsql/ral/migration/DropPipelineProcessConfigurationStatementTestCase.java
deleted file mode 100644
index e606a110bdc..00000000000
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/distsql/ral/migration/DropPipelineProcessConfigurationStatementTestCase.java
+++ /dev/null
@@ -1,35 +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.
- */
-
-package org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.ral.migration;
-
-import lombok.Getter;
-import lombok.Setter;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.SQLParserTestCase;
-
-import javax.xml.bind.annotation.XmlElement;
-
-/**
- * Drop pipeline process configuration test case.
- */
-@Getter
-@Setter
-public final class DropPipelineProcessConfigurationStatementTestCase extends SQLParserTestCase {
-
- @XmlElement(name = "conf-path")
- private String confPath;
-}
diff --git a/test/parser/src/main/resources/case/ral/migration.xml b/test/parser/src/main/resources/case/ral/migration.xml
index 36d8995dd40..41e6aa36c49 100644
--- a/test/parser/src/main/resources/case/ral/migration.xml
+++ b/test/parser/src/main/resources/case/ral/migration.xml
@@ -42,14 +42,6 @@
<job-id>123</job-id>
</show-migration-check-status>
- <drop-migration-process-configuration sql-case-id="drop-migration-process-configuration-read">
- <conf-path>/READ</conf-path>
- </drop-migration-process-configuration>
-
- <drop-migration-process-configuration sql-case-id="drop-migration-process-configuration-read-rate-limiter">
- <conf-path>/READ/RATE_LIMITER</conf-path>
- </drop-migration-process-configuration>
-
<migrate-table sql-case-id="migrate-table-without-schema-target-db">
<source-resource-name>ds_0</source-resource-name>
<source-table-name>t_order</source-table-name>
diff --git a/test/parser/src/main/resources/sql/supported/ral/migration.xml b/test/parser/src/main/resources/sql/supported/ral/migration.xml
index 39aa309a54c..a187e571508 100644
--- a/test/parser/src/main/resources/sql/supported/ral/migration.xml
+++ b/test/parser/src/main/resources/sql/supported/ral/migration.xml
@@ -25,8 +25,6 @@
<distsql-case id="show-migration-check-status" value="SHOW MIGRATION CHECK STATUS 123;" />
<distsql-case id="check-migration-with-type" value="CHECK MIGRATION 123 by TYPE(name='DEFAULT', PROPERTIES('test-property'='4'));" />
- <distsql-case id="drop-migration-process-configuration-read" value="DROP MIGRATION PROCESS CONFIGURATION '/READ';" />
- <distsql-case id="drop-migration-process-configuration-read-rate-limiter" value="DROP MIGRATION PROCESS CONFIGURATION '/READ/RATE_LIMITER';" />
<distsql-case id="migrate-table-without-schema-target-db" value="MIGRATE TABLE ds_0.t_order INTO t_order;" />
<distsql-case id="migrate-table-with-schema" value="MIGRATE TABLE ds_0.public.t_order INTO t_order;" />
<distsql-case id="migrate-table-with-target-db" value="MIGRATE TABLE ds_0.t_order INTO sharding_db.t_order;" />