ashulin commented on code in PR #2667:
URL:
https://github.com/apache/incubator-seatunnel/pull/2667#discussion_r965510947
##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/dag/physical/PhysicalPlan.java:
##########
@@ -85,53 +102,78 @@ public PhysicalPlan(@NonNull List<SubPlan> pipelineList,
}
this.jobFullName = String.format("Job %s (%s)",
jobImmutableInformation.getJobConfig().getName(),
jobImmutableInformation.getJobId());
+
+ pipelineSchedulerFutureMap = new HashMap<>(pipelineList.size());
+ }
+
+ public void setJobMaster(JobMaster jobMaster) {
+ this.jobMaster = jobMaster;
}
public void initStateFuture() {
- pipelineList.forEach(subPlan -> {
- PassiveCompletableFuture<PipelineState> future =
subPlan.initStateFuture();
- future.whenComplete((v, t) -> {
- // We need not handle t, Because we will not return t from
Pipeline
- if (PipelineState.CANCELED.equals(v)) {
+ pipelineList.forEach(subPlan -> addPipelineEndCallback(subPlan));
+ }
+
+ private void addPipelineEndCallback(SubPlan subPlan) {
+ PassiveCompletableFuture<PipelineState> future =
subPlan.initStateFuture();
+ future.whenComplete((pipelineState, throwable) -> {
+ // We need not handle t, Because we will not return t from Pipeline
Review Comment:
```suggestion
future.thenAcceptAsync(pipelineState -> {
```
If you do not need to handle throwable inside, you can use other methods
--
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]