apourchet commented on code in PR #16147:
URL: https://github.com/apache/kafka/pull/16147#discussion_r1624647021
##########
streams/src/main/java/org/apache/kafka/streams/processor/assignment/assignors/StickyTaskAssignor.java:
##########
@@ -331,7 +328,7 @@ public Set<ProcessId> findClientsWithoutAssignedTask(final
TaskId taskId) {
public double clientLoad(final ProcessId processId) {
final int capacity = clients.get(processId).numProcessingThreads();
- final double totalTaskCount =
newAssignments.getOrDefault(processId, new HashSet<>()).size();
+ final double totalTaskCount =
newAssignments.getOrDefault(processId, KafkaStreamsAssignment.of(processId, new
HashSet<>())).tasks().size();
Review Comment:
Yep, I'm already doing the initialization as you suggested, but never got
rid of the `getOrDefault`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]