apache / apache/gravitino

[Improvement] improvement Dispatcher mechanism

Open
#4,446 0 comments 0 reactions 0 assignees View on GitHub
improvement
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.