sandynz commented on code in PR #21194:
URL: https://github.com/apache/shardingsphere/pull/21194#discussion_r980702378


##########
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/consistencycheck/ConsistencyCheckJob.java:
##########
@@ -74,7 +74,7 @@ public void execute(final ShardingContext shardingContext) {
         }
         Map<String, String> checkResultMap = new LinkedHashMap<>();
         for (Entry<String, DataConsistencyCheckResult> entry : 
dataConsistencyCheckResult.entrySet()) {
-            YamlDataConsistencyCheckResultValue checkResult = 
CHECK_RESULT_SWAPPER.swapToYamlConfiguration(entry.getValue());
+            YamlDataConsistencyCheckResult checkResult = 
CHECK_RESULT_SWAPPER.swapToYamlConfiguration(entry.getValue());
             checkResultMap.put(entry.getKey(), 
YamlEngine.marshal(checkResult));
         }
         
PipelineAPIFactory.getGovernanceRepositoryAPI().persistCheckJobResult(referredJobId,
 checkJobId, YamlEngine.marshal(checkResultMap));

Review Comment:
   Could we put marshal and unmarshal to the same class, e.g. 
GovernanceRepositoryAPIImpl



##########
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/consistencycheck/ConsistencyCheckJobAPIImpl.java:
##########
@@ -110,10 +110,10 @@ public Map<String, DataConsistencyCheckResult> 
getLatestDataConsistencyCheckResu
     
     @Override
     public void persistJobItemProgress(final PipelineJobItemContext 
jobItemContext) {
-        DataCheckJobItemProgress progress = new DataCheckJobItemProgress();
+        ConsistencyCheckJobProgress progress = new 
ConsistencyCheckJobProgress();
         progress.setStatus(jobItemContext.getStatus());
-        YamlDataCheckJobProgress yamlDataCheckJobProgress = 
PROGRESS_SWAPPER.swapToYamlConfiguration(progress);
-        
PipelineAPIFactory.getGovernanceRepositoryAPI().persistJobItemProgress(jobItemContext.getJobId(),
 jobItemContext.getShardingItem(), 
YamlEngine.marshal(yamlDataCheckJobProgress));
+        YamlConsistencyCheckJobProgress yamlConsistencyCheckJobProgress = 
PROGRESS_SWAPPER.swapToYamlConfiguration(progress);

Review Comment:
   `yamlConsistencyCheckJobProgress` could be `yamlJobProgress`.
   
   `progress` could be `jobProgress`.



##########
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/consistencycheck/ConsistencyCheckJobAPIImpl.java:
##########
@@ -122,15 +122,15 @@ public PipelineJobItemProgress getJobItemProgress(final 
String jobId, final int
         if (StringUtils.isBlank(progress)) {
             return null;
         }
-        DataCheckJobItemProgress dataCheckJobItemProgress = 
PROGRESS_SWAPPER.swapToObject(YamlEngine.unmarshal(progress, 
YamlDataCheckJobProgress.class, true));
-        DataCheckJobItemProgress result = new DataCheckJobItemProgress();
-        result.setStatus(dataCheckJobItemProgress.getStatus());
+        ConsistencyCheckJobProgress consistencyCheckJobProgress = 
PROGRESS_SWAPPER.swapToObject(YamlEngine.unmarshal(progress, 
YamlConsistencyCheckJobProgress.class, true));
+        ConsistencyCheckJobProgress result = new ConsistencyCheckJobProgress();
+        result.setStatus(consistencyCheckJobProgress.getStatus());
         return result;
     }
     
     @Override
     public void updateJobItemStatus(final String jobId, final int 
shardingItem, final JobStatus status) {
-        DataCheckJobItemProgress jobItemProgress = (DataCheckJobItemProgress) 
getJobItemProgress(jobId, shardingItem);
+        ConsistencyCheckJobProgress jobItemProgress = 
(ConsistencyCheckJobProgress) getJobItemProgress(jobId, shardingItem);
         if (null == jobItemProgress) {

Review Comment:
   `jobItemProgress` could be `jobProgress`



##########
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/consistencycheck/ConsistencyCheckJobAPIImpl.java:
##########
@@ -122,15 +122,15 @@ public PipelineJobItemProgress getJobItemProgress(final 
String jobId, final int
         if (StringUtils.isBlank(progress)) {
             return null;
         }
-        DataCheckJobItemProgress dataCheckJobItemProgress = 
PROGRESS_SWAPPER.swapToObject(YamlEngine.unmarshal(progress, 
YamlDataCheckJobProgress.class, true));
-        DataCheckJobItemProgress result = new DataCheckJobItemProgress();
-        result.setStatus(dataCheckJobItemProgress.getStatus());
+        ConsistencyCheckJobProgress consistencyCheckJobProgress = 
PROGRESS_SWAPPER.swapToObject(YamlEngine.unmarshal(progress, 
YamlConsistencyCheckJobProgress.class, true));

Review Comment:
   `consistencyCheckJobProgress` could be `jobProgress`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to