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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]