You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/02/14 12:56:58 UTC

[GitHub] [shardingsphere] sandynz commented on a change in pull request #15408: For #15291: Fix the problem of the SwitchClusterConfiguration method does not modify the task status in the proxy cluster

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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org