28 lines
1.4 KiB
Diff
28 lines
1.4 KiB
Diff
# UNDF: UNDF-2026-000000301
|
|
# UNDF: (leave blank)
|
|
--- a/storm-client/src/jvm/org/apache/storm/daemon/worker/WorkerState.java
|
|
+++ b/storm-client/src/jvm/org/apache/storm/daemon/worker/WorkerState.java
|
|
@@ -109,7 +109,7 @@ public class WorkerState {
|
|
// local executors and localTaskIds running in this worker
|
|
- final ArrayList<Integer> localTaskIds;
|
|
+ final Set<Integer> localTaskIds;
|
|
|
|
@@ -190,7 +190,7 @@ public class WorkerState {
|
|
- this.localTaskIds = new ArrayList<>();
|
|
+ this.localTaskIds = new HashSet<>();
|
|
for (List<Long> executor : executors) {
|
|
List<Integer> taskIds = StormCommon.executorIdToTasks(executor);
|
|
this.localTaskIds.addAll(taskIds);
|
|
}
|
|
- Collections.sort(localTaskIds);
|
|
|
|
@@ -424,7 +424,7 @@ public class WorkerState {
|
|
for (Map.Entry<Integer, NodeInfo> taskToNodePortEntry : taskToNodePort.entrySet()) {
|
|
Integer task = taskToNodePortEntry.getKey();
|
|
if (outboundTasks.contains(task)) {
|
|
newTaskToNodePort.put(task, taskToNodePortEntry.getValue());
|
|
- if (!localTaskIds.contains(task)) {
|
|
+ if (!localTaskIds.contains(task)) { /* O(1) now that localTaskIds is HashSet */
|
|
neededConnections.add(taskToNodePortEntry.getValue());
|
|
}
|
|
}
|