sandynz commented on a change in pull request #15408:
URL: https://github.com/apache/shardingsphere/pull/15408#discussion_r805813761



##########
File path: 
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/core/api/impl/RuleAlteredJobAPIImpl.java
##########
@@ -314,18 +316,20 @@ public void switchClusterConfiguration(final 
JobConfiguration jobConfig) {
                 throw new PipelineDataConsistencyCheckFailedException("Data 
consistency check not finished or failed.");
             }
         }
-        Optional<Collection<RuleAlteredJobContext>> optionalJobContexts = 
RuleAlteredJobSchedulerCenter.getJobContexts(jobId);
-        optionalJobContexts.ifPresent(jobContexts -> jobContexts.forEach(each 
-> each.setStatus(JobStatus.ALMOST_FINISHED)));
+        List<String> offsetKeys = 
PipelineAPIFactory.getGovernanceRepositoryAPI().getChildrenKeys(String.format("%s/%s/offset",
 DataPipelineConstants.DATA_PIPELINE_ROOT, jobId));

Review comment:
       It's better not hard coded "%s/%s/offset" here.

##########
File path: 
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/core/api/impl/RuleAlteredJobAPIImpl.java
##########
@@ -357,4 +361,8 @@ private JobConfigurationPOJO getElasticJobConfigPOJO(final 
String jobId) {
         }
         return result;
     }
+    
+    private String getOffsetPath(final String jobId, final int shardingItem) {
+        return String.format("%s/%s/offset/%d", 
DataPipelineConstants.DATA_PIPELINE_ROOT, jobId, shardingItem);
+    }

Review comment:
       It's better not hard coded "%s/%s/offset/%d" here.




-- 
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