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 bdc746066b4 Add PipelineJobOption (#37104)
bdc746066b4 is described below
commit bdc746066b4453bcce439eb01dc4167609d4d294
Author: Liang Zhang <[email protected]>
AuthorDate: Sat Nov 15 00:40:51 2025 +0800
Add PipelineJobOption (#37104)
* Add PipelineJobOption
* Add PipelineJobOption
* Add PipelineJobOption
* Add PipelineJobOption
---
.../pipeline/core/job/type/PipelineJobOption.java | 50 ++++++++++++++++++++++
.../pipeline/core/job/type/PipelineJobType.java | 13 ++++--
.../pipeline/core/job/type/FixtureJobType.java | 5 +++
.../data/pipeline/cdc/CDCJobType.java | 6 +++
.../consistencycheck/ConsistencyCheckJobType.java | 7 +++
.../scenario/migration/MigrationJobType.java | 7 +++
6 files changed, 85 insertions(+), 3 deletions(-)
diff --git
a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/job/type/PipelineJobOption.java
b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/job/type/PipelineJobOption.java
new file mode 100644
index 00000000000..7dcf7d0517b
--- /dev/null
+++
b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/job/type/PipelineJobOption.java
@@ -0,0 +1,50 @@
+/*
+ * 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.data.pipeline.core.job.type;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.data.pipeline.core.job.PipelineJob;
+import
org.apache.shardingsphere.data.pipeline.core.job.config.yaml.swapper.YamlPipelineJobConfigurationSwapper;
+import
org.apache.shardingsphere.data.pipeline.core.job.progress.yaml.swapper.YamlPipelineJobItemProgressSwapper;
+
+/**
+ * Pipeline job type.
+ */
+@RequiredArgsConstructor
+@Getter
+public final class PipelineJobOption {
+
+ private final String code;
+
+ private final boolean isTransmissionJob;
+
+ private final YamlPipelineJobConfigurationSwapper<?, ?>
yamlJobConfigurationSwapper;
+
+ private final YamlPipelineJobItemProgressSwapper<?, ?>
yamlJobItemProgressSwapper;
+
+ private final Class<? extends PipelineJob> jobClass;
+
+ private final boolean
isIgnoreToStartDisabledJobWhenJobItemProgressIsFinished;
+
+ private final String getToBeStartDisabledNextJobType;
+
+ private final String getToBeStoppedPreviousJobType;
+
+ private final boolean isForceNoShardingWhenConvertToJobConfigurationPOJO;
+}
diff --git
a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/job/type/PipelineJobType.java
b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/job/type/PipelineJobType.java
index aa9886233f6..9eee123683c 100644
---
a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/job/type/PipelineJobType.java
+++
b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/job/type/PipelineJobType.java
@@ -41,6 +41,13 @@ import java.util.Optional;
@JsonIgnoreType
public interface PipelineJobType extends TypedSPI {
+ /**
+ * Get pipeline job option.
+ *
+ * @return pipeline job option
+ */
+ PipelineJobOption getOption();
+
/**
* Get job type code.
*
@@ -49,7 +56,7 @@ public interface PipelineJobType extends TypedSPI {
String getCode();
/**
- * Is transmission job.
+ * Whether transmission job.
*
* @return is transmission job or not
*/
@@ -132,8 +139,8 @@ public interface PipelineJobType extends TypedSPI {
* @return all logic tables check result
* @throws UnsupportedOperationException unsupported operation exception
*/
- default PipelineDataConsistencyChecker
buildDataConsistencyChecker(PipelineJobConfiguration jobConfig,
-
TransmissionProcessContext processContext,
ConsistencyCheckJobItemProgressContext progressContext) {
+ default PipelineDataConsistencyChecker buildDataConsistencyChecker(final
PipelineJobConfiguration jobConfig,
+ final
TransmissionProcessContext processContext, final
ConsistencyCheckJobItemProgressContext progressContext) {
throw new UnsupportedOperationException("Build data consistency
checker is not supported.");
}
diff --git
a/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/core/job/type/FixtureJobType.java
b/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/core/job/type/FixtureJobType.java
index c6988111e34..cbc3e3c555f 100644
---
a/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/core/job/type/FixtureJobType.java
+++
b/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/core/job/type/FixtureJobType.java
@@ -31,6 +31,11 @@ import
org.apache.shardingsphere.infra.util.yaml.YamlConfiguration;
*/
public final class FixtureJobType implements PipelineJobType {
+ @Override
+ public PipelineJobOption getOption() {
+ return new PipelineJobOption("00", true, null, null, null, false,
null, null, false);
+ }
+
@Override
public String getCode() {
return "00";
diff --git
a/kernel/data-pipeline/scenario/cdc/core/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/CDCJobType.java
b/kernel/data-pipeline/scenario/cdc/core/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/CDCJobType.java
index be6e1d76225..1aeaa5b5636 100644
---
a/kernel/data-pipeline/scenario/cdc/core/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/CDCJobType.java
+++
b/kernel/data-pipeline/scenario/cdc/core/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/CDCJobType.java
@@ -22,6 +22,7 @@ import
org.apache.shardingsphere.data.pipeline.cdc.config.yaml.swapper.YamlCDCJo
import org.apache.shardingsphere.data.pipeline.core.job.id.PipelineJobIdUtils;
import
org.apache.shardingsphere.data.pipeline.core.job.progress.yaml.swapper.YamlTransmissionJobItemProgressSwapper;
import
org.apache.shardingsphere.data.pipeline.core.job.service.PipelineJobConfigurationManager;
+import org.apache.shardingsphere.data.pipeline.core.job.type.PipelineJobOption;
import org.apache.shardingsphere.data.pipeline.core.job.type.PipelineJobType;
import org.apache.shardingsphere.data.pipeline.core.pojo.PipelineJobInfo;
import org.apache.shardingsphere.data.pipeline.core.pojo.PipelineJobMetaData;
@@ -31,6 +32,11 @@ import
org.apache.shardingsphere.data.pipeline.core.pojo.PipelineJobMetaData;
*/
public final class CDCJobType implements PipelineJobType {
+ @Override
+ public PipelineJobOption getOption() {
+ return new PipelineJobOption("03", true, new
YamlCDCJobConfigurationSwapper(), new YamlTransmissionJobItemProgressSwapper(),
CDCJob.class, false, null, null, true);
+ }
+
@Override
public String getCode() {
return "03";
diff --git
a/kernel/data-pipeline/scenario/consistency-check/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/consistencycheck/ConsistencyCheckJobType.java
b/kernel/data-pipeline/scenario/consistency-check/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/consistencycheck/ConsistencyCheckJobType.java
index 2bfc557d23d..e01448b4243 100644
---
a/kernel/data-pipeline/scenario/consistency-check/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/consistencycheck/ConsistencyCheckJobType.java
+++
b/kernel/data-pipeline/scenario/consistency-check/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/consistencycheck/ConsistencyCheckJobType.java
@@ -18,6 +18,7 @@
package org.apache.shardingsphere.data.pipeline.scenario.consistencycheck;
import
org.apache.shardingsphere.data.pipeline.core.job.progress.yaml.swapper.YamlConsistencyCheckJobItemProgressSwapper;
+import org.apache.shardingsphere.data.pipeline.core.job.type.PipelineJobOption;
import org.apache.shardingsphere.data.pipeline.core.job.type.PipelineJobType;
import org.apache.shardingsphere.data.pipeline.core.pojo.PipelineJobInfo;
import
org.apache.shardingsphere.data.pipeline.scenario.consistencycheck.config.yaml.swapper.YamlConsistencyCheckJobConfigurationSwapper;
@@ -27,6 +28,12 @@ import
org.apache.shardingsphere.data.pipeline.scenario.consistencycheck.config.
*/
public final class ConsistencyCheckJobType implements PipelineJobType {
+ @Override
+ public PipelineJobOption getOption() {
+ return new PipelineJobOption("02",
+ false, new YamlConsistencyCheckJobConfigurationSwapper(), new
YamlConsistencyCheckJobItemProgressSwapper(), ConsistencyCheckJob.class, true,
null, null, false);
+ }
+
@Override
public String getCode() {
return "02";
diff --git
a/kernel/data-pipeline/scenario/migration/core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/migration/MigrationJobType.java
b/kernel/data-pipeline/scenario/migration/core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/migration/MigrationJobType.java
index b744f5a906b..a3fc87e7144 100644
---
a/kernel/data-pipeline/scenario/migration/core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/migration/MigrationJobType.java
+++
b/kernel/data-pipeline/scenario/migration/core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/migration/MigrationJobType.java
@@ -24,6 +24,7 @@ import
org.apache.shardingsphere.data.pipeline.core.job.config.PipelineJobConfig
import org.apache.shardingsphere.data.pipeline.core.job.id.PipelineJobIdUtils;
import
org.apache.shardingsphere.data.pipeline.core.job.progress.yaml.swapper.YamlTransmissionJobItemProgressSwapper;
import
org.apache.shardingsphere.data.pipeline.core.job.service.PipelineJobConfigurationManager;
+import org.apache.shardingsphere.data.pipeline.core.job.type.PipelineJobOption;
import org.apache.shardingsphere.data.pipeline.core.job.type.PipelineJobType;
import org.apache.shardingsphere.data.pipeline.core.pojo.PipelineJobInfo;
import org.apache.shardingsphere.data.pipeline.core.pojo.PipelineJobMetaData;
@@ -40,6 +41,12 @@ import java.util.Optional;
*/
public final class MigrationJobType implements PipelineJobType {
+ @Override
+ public PipelineJobOption getOption() {
+ return new PipelineJobOption("01",
+ true, new YamlMigrationJobConfigurationSwapper(), new
YamlTransmissionJobItemProgressSwapper(), MigrationJob.class, false,
"CONSISTENCY_CHECK", "CONSISTENCY_CHECK", false);
+ }
+
@Override
public String getCode() {
return "01";