From b7d1e7db85f6d8c682e4369d5a29256145d9608e Mon Sep 17 00:00:00 2001 From: zhangliang Date: Thu, 23 Nov 2023 13:11:04 +0800 Subject: [PATCH] Rename PipelineJobInfo.tableName --- .../data/pipeline/common/pojo/PipelineJobInfo.java | 3 +-- .../core/job/service/InventoryIncrementalJobManager.java | 4 ++-- .../cdc/distsql/handler/query/ShowStreamingListExecutor.java | 2 +- .../distsql/handler/query/ShowMigrationListExecutor.java | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/common/pojo/PipelineJobInfo.java b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/common/pojo/PipelineJobInfo.java index 44ba79c520604..c6d136d48e2cf 100644 --- a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/common/pojo/PipelineJobInfo.java +++ b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/common/pojo/PipelineJobInfo.java @@ -31,6 +31,5 @@ public final class PipelineJobInfo { private final String databaseName; - // TODO Rename - private final String table; + private final String tableName; } diff --git a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/job/service/InventoryIncrementalJobManager.java b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/job/service/InventoryIncrementalJobManager.java index dbdf9aadcb0ba..ee9f2ef5bc315 100644 --- a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/job/service/InventoryIncrementalJobManager.java +++ b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/job/service/InventoryIncrementalJobManager.java @@ -86,7 +86,7 @@ public List getJobItemInfos(final String jobId) InventoryIncrementalJobItemProgress jobItemProgress = entry.getValue(); String errorMessage = new PipelineJobIteErrorMessageManager(jobId, shardingItem).getErrorMessage(); if (null == jobItemProgress) { - result.add(new InventoryIncrementalJobItemInfo(shardingItem, jobInfo.getTable(), null, startTimeMillis, 0, errorMessage)); + result.add(new InventoryIncrementalJobItemInfo(shardingItem, jobInfo.getTableName(), null, startTimeMillis, 0, errorMessage)); continue; } int inventoryFinishedPercentage = 0; @@ -95,7 +95,7 @@ public List getJobItemInfos(final String jobId) } else if (0 != jobItemProgress.getProcessedRecordsCount() && 0 != jobItemProgress.getInventoryRecordsCount()) { inventoryFinishedPercentage = (int) Math.min(100, jobItemProgress.getProcessedRecordsCount() * 100 / jobItemProgress.getInventoryRecordsCount()); } - result.add(new InventoryIncrementalJobItemInfo(shardingItem, jobInfo.getTable(), jobItemProgress, startTimeMillis, inventoryFinishedPercentage, errorMessage)); + result.add(new InventoryIncrementalJobItemInfo(shardingItem, jobInfo.getTableName(), jobItemProgress, startTimeMillis, inventoryFinishedPercentage, errorMessage)); } return result; } diff --git a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/cdc/distsql/handler/query/ShowStreamingListExecutor.java b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/cdc/distsql/handler/query/ShowStreamingListExecutor.java index 4abb07b7ce5ea..5e4404be248f2 100644 --- a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/cdc/distsql/handler/query/ShowStreamingListExecutor.java +++ b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/cdc/distsql/handler/query/ShowStreamingListExecutor.java @@ -40,7 +40,7 @@ public final class ShowStreamingListExecutor implements QueryableRALExecutor getRows(final ShowStreamingListStatement sqlStatement) { return pipelineJobManager.getJobInfos(new PipelineContextKey(InstanceType.PROXY)).stream().map(each -> new LocalDataQueryResultRow(each.getJobMetaData().getJobId(), - each.getDatabaseName(), each.getTable(), + each.getDatabaseName(), each.getTableName(), each.getJobMetaData().getJobItemCount(), each.getJobMetaData().isActive() ? Boolean.TRUE.toString() : Boolean.FALSE.toString(), each.getJobMetaData().getCreateTime(), Optional.ofNullable(each.getJobMetaData().getStopTime()).orElse(""))).collect(Collectors.toList()); } diff --git a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/migration/distsql/handler/query/ShowMigrationListExecutor.java b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/migration/distsql/handler/query/ShowMigrationListExecutor.java index 3f1ec3deb4c7c..33076af240172 100644 --- a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/migration/distsql/handler/query/ShowMigrationListExecutor.java +++ b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/migration/distsql/handler/query/ShowMigrationListExecutor.java @@ -39,7 +39,7 @@ public final class ShowMigrationListExecutor implements QueryableRALExecutor getRows(final ShowMigrationListStatement sqlStatement) { return pipelineJobManager.getJobInfos(new PipelineContextKey(InstanceType.PROXY)).stream().map(each -> new LocalDataQueryResultRow(each.getJobMetaData().getJobId(), - each.getTable(), each.getJobMetaData().getJobItemCount(), + each.getTableName(), each.getJobMetaData().getJobItemCount(), each.getJobMetaData().isActive() ? Boolean.TRUE.toString() : Boolean.FALSE.toString(), each.getJobMetaData().getCreateTime(), each.getJobMetaData().getStopTime())).collect(Collectors.toList()); }