lihaosky commented on code in PR #14030: URL: https://github.com/apache/kafka/pull/14030#discussion_r1271098823
########## streams/src/main/java/org/apache/kafka/streams/processor/internals/assignment/RackAwareTaskAssignor.java: ########## @@ -38,29 +43,34 @@ public class RackAwareTaskAssignor { private static final Logger log = LoggerFactory.getLogger(RackAwareTaskAssignor.class); + private static final int DEFAULT_STATEFUL_TRAFFIC_COST = 10; Review Comment: One thing missing here is that I intend to have different default stateful traffic cost and non-overlap cost for `StickyAssignor` and `HAAssignor`, so instead of hardcoding here, maybe it makes more sense to pass in from constructor or assign() call. This brings to another question of where should `RackAwareTaskAssignor` be constructed. Before `StickyAssignor` and `HAAssignor` are constructed using reflection, we can't pass `RackAwareTaskAssignor` to them via their constructor. We can construct `RackAwareTaskAssignor` inside them, but constructor of `RackAwareTaskAssignor` requires a lot more params than `HAAssignor`'s assign() call. So I'm thinking construct `RackAwareTaskAssignor` inside `StreamsPartitionAssignor` and pass it to `HAAssignor` or `StickyAssignor` using `assignmentConfig` variable... -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org