-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#4309] feat(core): support tag events for event listener #5847
Conversation
// TODO: getTagFailureEvent | ||
throw e; | ||
} | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think TagEventDispatcher should forward requests to the TagManager?
Something like return dispathcer.getTag(metalake, name)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, if not forwarding request, the tag request will takes no effect after this PR is merged.
suggest not moving |
The architecture looks good to me. |
|
||
import org.apache.gravitino.annotation.Evolving; | ||
import org.apache.gravitino.exceptions.NoSuchTagException; | ||
import org.apache.gravitino.exceptions.TagAlreadyAssociatedException; | ||
import org.apache.gravitino.tag.Tag; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we do such changes in the API level? It will basically break the compatibility. If there's no strong reason, we should not do a such change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do not move the Supports in the API module, it will conflict with the one in the core module. I referred to other designs under the API, such as catalog, and moved it out of the Tag folder. Would you happen to have any good suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can have two options:
- No need to use dispatcher pattern, just implement the listener logic in
TagManager
. - To refer to
PatitionDispatcher
, just add the methods in thisTagDispatcher
interface, no need to have anotherSupportsXXX
interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Jerry,
I decided to go with Option 2 and have completed the implementation.
|
630132f
to
4e2acad
Compare
String[] listTagsForMetadataObject(String metalake, MetadataObject metadataObject); | ||
|
||
/** | ||
* @param metalake |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please complement the java doc
@@ -485,5 +489,6 @@ private void initGravitinoServerComponents() { | |||
|
|||
// Tag manager | |||
this.tagManager = new TagManager(idGenerator, entityStore); | |||
this.tagDispatcher = new TagEventDispatcher(eventBus, tagManager); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to keep tagManager
as a member of GravitinoEnv
class?
// TODO: getTagFailureEvent | ||
throw e; | ||
} | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, if not forwarding request, the tag request will takes no effect after this PR is merged.
4e2acad
to
e57f980
Compare
e57f980
to
6a33ebb
Compare
6652303
to
adb7c97
Compare
@FANNG1 All comments have been addressed, and changes have been pushed. Please take another look when convenient. Thanks for the thorough review! |
core/src/main/java/org/apache/gravitino/listener/TagEventDispatcher.java
Outdated
Show resolved
Hide resolved
LGTM, @TungYuChiang do you like to add tag event in this PR or create a new PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TungYuChiang Thank you for your contributions.
LGTM
@FANNG1 I prefer create a new PR, I will open a new issue and create a few subtasks so that others can participate |
What changes were proposed in this pull request?
support tag events for event listener
Why are the changes needed?
Fix: #4309
Does this PR introduce any user-facing change?
no
How was this patch tested?
existing tests