Skip to content

Commit

Permalink
[bugfix][zeta] Fix the issue of two identical IDs appearing when exec…
Browse files Browse the repository at this point in the history
…uting seatunnel.sh -l as the job resumes (apache#5191)
  • Loading branch information
ic4y authored and liunaijie committed Aug 12, 2023
1 parent c2f4d6e commit adb291c
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class JobHistoryService {
Expand Down Expand Up @@ -101,10 +103,15 @@ public JobHistoryService(
// Gets the status of a running and completed job
public String listAllJob() {
List<JobStatusData> status = new ArrayList<>();
Set<Long> runningJonIds =
runningJobMasterMap.values().stream()
.map(master -> master.getJobImmutableInformation().getJobId())
.collect(Collectors.toSet());
Stream.concat(
runningJobMasterMap.values().stream()
.map(master -> toJobStateMapper(master, true)),
finishedJobStateImap.values().stream())
finishedJobStateImap.values().stream()
.filter(jobState -> !runningJonIds.contains(jobState.getJobId())))
.forEach(
jobState -> {
JobStatusData jobStatusData =
Expand Down

0 comments on commit adb291c

Please sign in to comment.