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/10 04:04:36 UTC

[shardingsphere] branch master updated: Rename MigrationJobInfo to TableBasedPipelineJobInfo (#21440)

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 f2578fd7415 Rename MigrationJobInfo to TableBasedPipelineJobInfo (#21440)
f2578fd7415 is described below

commit f2578fd7415c3a13909b3af161f520a8f6c4e0b7
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Mon Oct 10 12:04:28 2022 +0800

    Rename MigrationJobInfo to TableBasedPipelineJobInfo (#21440)
    
    * Rename MigrationJobInfo to TableBasedPipelineJobInfo
    
    * Rename MigrationJobInfo to TableBasedPipelineJobInfo
---
 .../distsql/handler/query/ShowMigrationListQueryResultSet.java   | 3 ++-
 .../{MigrationJobInfo.java => TableBasedPipelineJobInfo.java}    | 9 ++++-----
 .../data/pipeline/scenario/migration/MigrationJobAPIImpl.java    | 6 +++---
 .../data/pipeline/core/api/impl/MigrationJobAPIImplTest.java     | 4 ++--
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/migration/distsql/handler/query/ShowMigrationListQueryResultSet.java b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/migration/distsql/handler/query/ShowMigrationListQueryResultSet.java
index f82d8128ecb..65125ef9ceb 100644
--- a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/migration/distsql/handler/query/ShowMigrationListQueryResultSet.java
+++ b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/migration/distsql/handler/query/ShowMigrationListQueryResultSet.java
@@ -19,6 +19,7 @@ package org.apache.shardingsphere.migration.distsql.handler.query;
 
 import org.apache.shardingsphere.data.pipeline.api.MigrationJobPublicAPI;
 import org.apache.shardingsphere.data.pipeline.api.PipelineJobPublicAPIFactory;
+import org.apache.shardingsphere.data.pipeline.api.pojo.TableBasedPipelineJobInfo;
 import org.apache.shardingsphere.infra.distsql.query.DatabaseDistSQLResultSet;
 import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
 import org.apache.shardingsphere.migration.distsql.statement.ShowMigrationListStatement;
@@ -45,7 +46,7 @@ public final class ShowMigrationListQueryResultSet implements DatabaseDistSQLRes
                 .map(each -> {
                     Collection<Object> result = new LinkedList<>();
                     result.add(each.getJobId());
-                    result.add(each.getTable());
+                    result.add(((TableBasedPipelineJobInfo) each).getTable());
                     result.add(each.getShardingTotalCount());
                     result.add(each.isActive() ? Boolean.TRUE.toString() : Boolean.FALSE.toString());
                     result.add(each.getCreateTime());
diff --git a/kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/api/pojo/MigrationJobInfo.java b/kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/api/pojo/TableBasedPipelineJobInfo.java
similarity index 86%
rename from kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/api/pojo/MigrationJobInfo.java
rename to kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/api/pojo/TableBasedPipelineJobInfo.java
index e7568e1b61e..283e1d45030 100644
--- a/kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/api/pojo/MigrationJobInfo.java
+++ b/kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/api/pojo/TableBasedPipelineJobInfo.java
@@ -22,17 +22,16 @@ import lombok.Setter;
 import lombok.ToString;
 
 /**
- * Migration job info.
+ * Table based pipeline job info.
  */
-
-@Setter
 @Getter
+@Setter
 @ToString(callSuper = true)
-public final class MigrationJobInfo extends PipelineJobInfo {
+public final class TableBasedPipelineJobInfo extends PipelineJobInfo {
     
     private String table;
     
-    public MigrationJobInfo(final String jobId) {
+    public TableBasedPipelineJobInfo(final String jobId) {
         super(jobId);
     }
 }
diff --git a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/migration/MigrationJobAPIImpl.java b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/migration/MigrationJobAPIImpl.java
index cca42cb6f9a..b2c8091930f 100644
--- a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/migration/MigrationJobAPIImpl.java
+++ b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/migration/MigrationJobAPIImpl.java
@@ -48,7 +48,7 @@ import org.apache.shardingsphere.data.pipeline.api.metadata.SchemaName;
 import org.apache.shardingsphere.data.pipeline.api.metadata.SchemaTableName;
 import org.apache.shardingsphere.data.pipeline.api.metadata.TableName;
 import org.apache.shardingsphere.data.pipeline.api.pojo.CreateMigrationJobParameter;
-import org.apache.shardingsphere.data.pipeline.api.pojo.MigrationJobInfo;
+import org.apache.shardingsphere.data.pipeline.api.pojo.TableBasedPipelineJobInfo;
 import org.apache.shardingsphere.data.pipeline.core.api.PipelineAPIFactory;
 import org.apache.shardingsphere.data.pipeline.core.api.impl.AbstractInventoryIncrementalJobAPIImpl;
 import org.apache.shardingsphere.data.pipeline.core.api.impl.PipelineDataSourcePersistService;
@@ -123,8 +123,8 @@ public final class MigrationJobAPIImpl extends AbstractInventoryIncrementalJobAP
     }
     
     @Override
-    protected MigrationJobInfo getJobInfo(final String jobId) {
-        MigrationJobInfo result = new MigrationJobInfo(jobId);
+    protected TableBasedPipelineJobInfo getJobInfo(final String jobId) {
+        TableBasedPipelineJobInfo result = new TableBasedPipelineJobInfo(jobId);
         JobConfigurationPOJO jobConfigPOJO = getElasticJobConfigPOJO(jobId);
         fillJobInfo(result, jobConfigPOJO);
         result.setTable(getJobConfiguration(jobConfigPOJO).getSourceTableName());
diff --git a/test/pipeline/src/test/java/org/apache/shardingsphere/data/pipeline/core/api/impl/MigrationJobAPIImplTest.java b/test/pipeline/src/test/java/org/apache/shardingsphere/data/pipeline/core/api/impl/MigrationJobAPIImplTest.java
index f1bae44e529..d5ae171c579 100644
--- a/test/pipeline/src/test/java/org/apache/shardingsphere/data/pipeline/core/api/impl/MigrationJobAPIImplTest.java
+++ b/test/pipeline/src/test/java/org/apache/shardingsphere/data/pipeline/core/api/impl/MigrationJobAPIImplTest.java
@@ -29,7 +29,7 @@ import org.apache.shardingsphere.data.pipeline.api.job.JobType;
 import org.apache.shardingsphere.data.pipeline.api.job.progress.InventoryIncrementalJobItemProgress;
 import org.apache.shardingsphere.data.pipeline.api.metadata.model.PipelineColumnMetaData;
 import org.apache.shardingsphere.data.pipeline.api.pojo.CreateMigrationJobParameter;
-import org.apache.shardingsphere.data.pipeline.api.pojo.MigrationJobInfo;
+import org.apache.shardingsphere.data.pipeline.api.pojo.TableBasedPipelineJobInfo;
 import org.apache.shardingsphere.data.pipeline.api.pojo.PipelineJobInfo;
 import org.apache.shardingsphere.data.pipeline.core.datasource.creator.PipelineDataSourceCreatorFactory;
 import org.apache.shardingsphere.data.pipeline.core.util.JobConfigurationBuilder;
@@ -95,7 +95,7 @@ public final class MigrationJobAPIImplTest {
         assertTrue(jobId.isPresent());
         PipelineJobInfo jobInfo = getNonNullJobInfo(jobId.get());
         assertTrue(jobInfo.isActive());
-        assertThat(((MigrationJobInfo) jobInfo).getTable(), is("t_order"));
+        assertThat(((TableBasedPipelineJobInfo) jobInfo).getTable(), is("t_order"));
         assertThat(jobInfo.getShardingTotalCount(), is(1));
     }