-
Notifications
You must be signed in to change notification settings - Fork 390
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
[#5901] feat(core): support tag event to Gravitino server #5998
base: main
Are you sure you want to change the base?
Conversation
@@ -72,7 +85,10 @@ public Tag getTag(String metalake, String name) throws NoSuchTagException { | |||
// TODO: getTagPreEvent | |||
try { | |||
// TODO: getTagEvent |
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.
Redundant line?
@@ -121,7 +150,11 @@ public MetadataObject[] listMetadataObjectsForTag(String metalake, String name) | |||
// TODO: listMetadataObjectsForTagPreEvent | |||
try { | |||
// TODO: listMetadataObjectsForTagEvent |
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.
Redundant line?
It would be better to turn this PR into a draft before updating the unit tests. |
aba70be
to
42e0f47
Compare
will review the PR until #5944 is merged for some duplicated logic, please wait for a while. |
@TungYuChiang could you rebase your code since #5944 is merged |
cc @cool9850311 |
sure, I will complete it within the next few days. |
a680fe6
to
43c2d20
Compare
// TODO: listTagsEvent | ||
return dispatcher.listTags(metalake); | ||
String[] tagNames = dispatcher.listTags(metalake); | ||
eventBus.dispatchEvent(new ListTagEvent(PrincipalUtils.getCurrentUserName(), 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.
could you rename ListTagsFailureEvent to ListTagFailureEvent to keep consistent with other list event?
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.
could you rename ListTagsFailureEvent to ListTagFailureEvent to keep consistent with other list event?
@FANNG1 , Would it be better to rename ListTagEvent
to ListTagsEvent
?
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.
Yes, ListTagsEvent
is better
core/src/main/java/org/apache/gravitino/listener/TagEventDispatcher.java
Show resolved
Hide resolved
Event represents an specific operation to specific resource, the current implement pass |
please update the document too |
@TungYuChiang any progress? If this PR is merged these days, we could meet the 0.8 release. |
@FANNG1 , I’m sorry for the delay. I’ve been a bit busy these past few days, but I’ll finish it by tomorrow evening. |
no hurry, please take your time |
43c2d20
to
22722e2
Compare
@FANNG1, I have fixed everything except renaming |
26214d8
to
2c66d22
Compare
9740fcb
to
64a293c
Compare
|
* @param tag The {@link Tag} object representing the retrieved tag. | ||
*/ | ||
public GetTagEvent(String user, String metalake, String tagName, Tag tag) { | ||
super(user, NameIdentifier.of(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 use NameIdentifierUtil.ofTag(metalake, tagName)
as resourceIdentifier.
// TODO: getTagEvent | ||
return dispatcher.getTag(metalake, name); | ||
Tag tag = dispatcher.getTag(metalake, name); | ||
eventBus.dispatchEvent( |
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 create TagInfo
and passing TagInfo
to GetTagEvent
// TODO: listTagsEvent | ||
return dispatcher.listTags(metalake); | ||
String[] tagNames = dispatcher.listTags(metalake); | ||
eventBus.dispatchEvent(new ListTagsEvent(PrincipalUtils.getCurrentUserName(), 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 passing tagNames
to ListTagsEvent
// TODO: getTagForMetadataObjectEvent | ||
return dispatcher.getTagForMetadataObject(metalake, metadataObject, name); | ||
Tag tag = dispatcher.getTagForMetadataObject(metalake, metadataObject, name); | ||
eventBus.dispatchEvent( |
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 use TagInfo
public AlterTagEvent( | ||
String user, String metalake, TagChange[] tagChanges, TagInfo updatedTagInfo) { | ||
super(user, NameIdentifier.of(metalake)); | ||
this.tagChanges = tagChanges; |
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 use clone
this.tagChanges = tagChanges.clone();
*/ | ||
public AlterTagEvent( | ||
String user, String metalake, TagChange[] tagChanges, TagInfo updatedTagInfo) { | ||
super(user, NameIdentifier.of(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.
use NameIdentifierUtil.ofTag(metalake, tagName)
as identifier
super(user, NameIdentifier.of(metalake)); | ||
this.metalake = metalake; | ||
this.metadataObject = metadataObject; | ||
this.tagsToAdd = tagsToAdd; |
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.
use clone for tagsToAdd
tagsToRemove
associatedTags
String[] tagsToAdd, | ||
String[] tagsToRemove, | ||
String[] associatedTags) { | ||
super(user, NameIdentifier.of(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 use MetadataObjectUtil.toEntityIdent(metalake, metadataObject)
as identifier
* | ||
* @return The {@link MetadataObject} with which the tags were associated. | ||
*/ | ||
public MetadataObject metadataObject() { |
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 remove this, duplicated with identifier
* | ||
* @return The metalake from which the tags were associated. | ||
*/ | ||
public String 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 remove this, duplicated with identifier
@TungYuChiang , please refer to |
I will fix it in the next few days. |
What changes were proposed in this pull request?
Why are the changes needed?
Fix: #5901
Does this PR introduce any user-facing change?
no
How was this patch tested?