[Improvement] improvement Dispatcher mechanism
- Dominant language
- Java
- Stars
- 3.2k
- Forks
- 935
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 315
Description
### What would you like to be improved?
Currently we need to wrap `Dispatcher` too many times.
https://github.com/apache/gravitino/blob/main/core/src/main/java/org/apache/gravitino/GravitinoEnv.java#L351
```
MetalakeDispatcher metalakeManager = new MetalakeManager(entityStore, idGenerator);
MetalakeNormalizeDispatcher metalakeNormalizeDispatcher =
new MetalakeNormalizeDispatcher(installDispatcherHooks(metalakeManager));
this.metalakeDispatcher = new MetalakeEventDispatcher(eventBus, metalakeNormalizeDispatcher);
```
I think we can improvement `Dispatcher` mechanism in the future.
+ https://github.com/apache/gravitino/pull/4429#discussion_r1709314924
### How should we improve?
_No response_
Contributor guide
Research direction
Start with the Dispatcher construction in core/src/main/java/org/apache/gravitino/GravitinoEnv.java around line 351, then read the referenced discussion in PR 4429. Trace how MetalakeManager, MetalakeNormalizeDispatcher, and MetalakeEventDispatcher are composed. Done should mean a clearer Dispatcher mechanism that reduces repeated wrapping while preserving the existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100