Github user tillrohrmann commented on the pull request: https://github.com/apache/flink/pull/917#issuecomment-123737269 * I chose to call the method `decorateMessage` because it not necessarily only attaches leader session IDs. In the future we might use this method for something other than just wrapping the messages in a `LeaderSessionMessage`. Moreover, calling it `attachSession` would contradict the idea of transparency here. But we can change it as long as we don't have to do any other decorations. * The trait `RequiresLeaderSessionID` is only a marker trait which does not contain any code. Thus, it is effectively equivalent to a Java interface and in fact Java classes can implement it. The only reason I chose a trait instead of an interface is that all messages which are sent by the actors are implemented as Scala classes. I can change it to be an interface, however I don't think that it cements the language blend. * I agree that it's not necessary to use mixins here. The reason to implement the logging and leader session message decoration as a mixin was just the beauty of the implementation. But I forgot about the clumsy names in the log output. I will include the mixins in the class `FlinkActor`. * It is true that the leader session ID can change in the case of HA with ZooKeeper. However, the ZooKeeper HA is not part of this PR.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---