iodone opened a new issue #1798: URL: https://github.com/apache/incubator-kyuubi/issues/1798
### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) ### Search before asking - [X] I have searched in the [issues](https://github.com/apache/incubator-kyuubi/issues?q=is%3Aissue) and found no similar issues. ### Describe the feature 1. Add EventBus module to unify the distribution and subscription of Kyuubi's events. 2. The addition of the EventBus module will not have task-intrusive changes to the existing business logic. ### Motivation The EventBus concept was introduced to solve the following problems. 1. Kyuubi Event does not implement a unified event distribution logic and needs to rely on the event's subscribers to implement the receiving logic (`EventLoggerService.onEvent`). If you need to access many subscribers like EventLoggerService, it will result in calling the subscriber's methods for receiving events one by one. 2. `EventLoggerService` should only focus on processing events and register to receive events of the corresponding type in a unified place, without coupling in each business logic to call onEvent to receive events. 3. If we follow EventLoggerSevice's way to implement #908 to add AuditLog, we will intrusively modify the `EventLoggerService` code because we need to add the `onAuditEvent` method to receive the corresponding new events. 4. Provides a unified asynchronous event handling model. ### Describe the solution EventBus Implemented in the following ways: 1. Decouple the distribution and subscription logic of events through EventBus. The subscribed events can be similar to EventLogService pattern or any other event processing, not necessarily event logger related. 2. Adding EventBus will not change the existing EventLoggerService logic, just register `EventLoggerService` to`EventBus` to finish listening to events. 3. All events are triggered by `EventBus.post` instead of `EventLoggerService.onEvent`. 4. If you want to implement AudiLog, you only need to add the corresponding `AuditEvent` and the corresponding subscription logic implementation, the implementation of the subscription logic can be reused `EventLoggerService` pattern, add an AuditLogger can be; or a separate implementation of a similar AuditLoggerService, will be registered to the EventBus. ### Additional context _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! -- 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]
