Github user andrewor14 commented on the pull request:
https://github.com/apache/spark/pull/4006#issuecomment-71905267
@zsxwing I looked at this in greater detail and I have a better
understanding of the design choices you made here. The bottom line is that the
common properties between `LiveListenerBus` and `StreamingListenerBus` include
(1) they both post events in a separate thread asynchronously, and (2) they're
both listener buses, but use different types of listeners and events.
Therefore, your hierarchy is as follows:
```
ListenerHelper[L, E]
/ \
SparkListenerBus ListenerBus[L, E]
/ \ /
\
ReplayListenerBus LiveListenerBus StreamingListenerBus
```
Although this placement of functionality makes sense, I find the naming of
the classes very confusing. For instance, it's very strange that
`LiveListenerBus` extends both `ListenerBus` and `SparkListenerBus`. From the
name, it would appear that `SparkListenerBus` is also an instance of
`ListenerBus`, but it is not. Similarly, I would imagine (from the name of the
classes) that `ReplayListenerBus` also extends `ListenerBus`, but this is not
the case.
So my proposal is the following. Rename your `ListenerHelper` to
`ListenerBus`, and your `ListenerBus` to something else, maybe
`AsynchronousListenerBus` or something because it posts events to listeners
asynchronously in a separate thread.
Do you agree?
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]