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/10/26 02:09:53 UTC

[GitHub] [shardingsphere] sandynz commented on a diff in pull request #21750: Improve stop pipeline job, extract method to the upper level

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


##########
kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/migration/MigrationJob.java:
##########
@@ -118,10 +118,8 @@ public void stop() {
             return;
         }
         log.info("stop tasks runner, jobId={}", jobId);
-        String jobBarrierDisablePath = PipelineMetaDataNode.getJobBarrierDisablePath(jobId);
         for (PipelineTasksRunner each : getTasksRunnerMap().values()) {
             each.stop();
-            pipelineDistributedBarrier.persistEphemeralChildrenNode(jobBarrierDisablePath, each.getJobItemContext().getShardingItem());

Review Comment:
   There's still `persistEphemeralChildrenNode` invocation in `execute`, could it be put to common method?



##########
kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/job/PipelineJobCenter.java:
##########
@@ -59,14 +63,20 @@ public static boolean isJobExisting(final String jobId) {
      * Stop job.
      *
      * @param jobId job id
+     * @param isAsync is async to stop
      */
-    public static void stop(final String jobId) {
+    public static void stop(final String jobId, final boolean isAsync) {

Review Comment:
   It's better not add new parameter, since:
   1, Most of cases use `true` for `isAsync` param;
   2, We could do `persistEphemeralChildrenNode` just on where it call this `stop` and use `false` for `isAysnc`;
   



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