use of com.flink.platform.common.enums.ExecutionStatus.RUNNING in project flink-platform-backend by itinycheng.
the class FlowExecuteThread method run.
@Override
public void run() {
// Update status of jobFlowRun.
JobFlowRun newJobFlowRun = new JobFlowRun();
newJobFlowRun.setId(jobFlowRun.getId());
newJobFlowRun.setStatus(RUNNING);
jobFlowRunService.updateById(newJobFlowRun);
// Process job flow.
JobFlowDag flow = jobFlowRun.getFlow();
flow.getBeginVertices().forEach(jobVertex -> execVertex(jobVertex, flow));
// Wait until all vertices are executed.
while (JobFlowDagHelper.hasUnExecutedVertices(flow)) {
ThreadUtil.sleep(5000);
}
// Wait for all jobs complete.
CompletableFuture.allOf(runningJobs.values().toArray(new CompletableFuture[0])).thenAccept(unused -> completeAndNotify(flow)).thenAccept(unused -> jobExecService.shutdownNow());
}
Aggregations