java-topology/defects/flink/patch/flink-0001.patch

47 lines
1.7 KiB
Diff

# UNDF: UNDF-2026-000000072
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobGraph.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobGraph.java
@@ -117,8 +117,8 @@
- /** Set of JAR files required to run this job. */
- private final List<Path> userJars = new ArrayList<Path>();
+ /** Set of JAR files required to run this job (LinkedHashSet for O(1) dedup). */
+ private final LinkedHashSet<Path> userJars = new LinkedHashSet<>();
- /** Set of blob keys identifying the JAR files required to run this job. */
- private final List<PermanentBlobKey> userJarBlobKeys = new ArrayList<>();
+ /** Set of blob keys identifying the JAR files required to run this job (LinkedHashSet for O(1) dedup). */
+ private final LinkedHashSet<PermanentBlobKey> userJarBlobKeys = new LinkedHashSet<>();
@@ -563,9 +563,7 @@
public void addJar(Path jar) {
if (jar == null) {
throw new IllegalArgumentException();
}
- if (!userJars.contains(jar)) {
- userJars.add(jar);
- }
+ userJars.add(jar);
}
@@ -631,9 +629,7 @@
public void addUserJarBlobKey(PermanentBlobKey key) {
if (key == null) {
throw new IllegalArgumentException();
}
- if (!userJarBlobKeys.contains(key)) {
- userJarBlobKeys.add(key);
- }
+ userJarBlobKeys.add(key);
}
@@ -596,3 +594,3 @@
public List<Path> getUserJars() {
- return userJars;
+ return new ArrayList<>(userJars);
}
@@ -656,3 +654,3 @@
public List<PermanentBlobKey> getUserJarBlobKeys() {
- return this.userJarBlobKeys;
+ return new ArrayList<>(userJarBlobKeys);
}