From 9562143f0856608fba746bed28d0bd75a4516660 Mon Sep 17 00:00:00 2001 From: "A. Sophie Blee-Goldman" Date: Tue, 28 May 2024 21:35:02 -0700 Subject: [PATCH] HOTFIX: remove unnecessary list creation (#16117) Removing a redundant list declaration in the new StickyTaskAssignor implementation Reviewers: Antoine Pourchet --- .../processor/assignment/assignors/StickyTaskAssignor.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/streams/src/main/java/org/apache/kafka/streams/processor/assignment/assignors/StickyTaskAssignor.java b/streams/src/main/java/org/apache/kafka/streams/processor/assignment/assignors/StickyTaskAssignor.java index aa8b174198ab4..2f6745e96815c 100644 --- a/streams/src/main/java/org/apache/kafka/streams/processor/assignment/assignors/StickyTaskAssignor.java +++ b/streams/src/main/java/org/apache/kafka/streams/processor/assignment/assignors/StickyTaskAssignor.java @@ -78,9 +78,7 @@ public TaskAssignment assign(final ApplicationState applicationState) { finalAssignments.put(clientId, previousAssignment.withFollowupRebalance(Instant.ofEpochMilli(0))); } - final Collection taskAssignments = finalAssignments.entrySet().stream() - .map(Map.Entry::getValue).collect(Collectors.toList()); - return new TaskAssignment(taskAssignments); + return new TaskAssignment(finalAssignments.values()); } private void optimizeActive(final ApplicationState applicationState,