-
Notifications
You must be signed in to change notification settings - Fork 395
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
[#5902] feat: Add tag failure event to Gravitino server #5944
Conversation
### What changes were proposed in this pull request? Add tag failure event to Gravitino server ### Why are the changes needed? Subtask: apache#5902 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Unit tests.
core/src/main/java/org/apache/gravitino/listener/TagEventDispatcher.java
Show resolved
Hide resolved
|
||
public class TagFailureEvent extends FailureEvent { | ||
public TagFailureEvent(String user, Exception exception) { | ||
super(user, null, exception); |
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.
identifier should not be null for tag 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.
What should I pass here?
DELETE_TAG, | ||
ALTER_TAG, | ||
LIST_TAG, | ||
TAG_EXISTS, |
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.
TAG_EXISTS
not used? please remove it
throw e; | ||
} | ||
} | ||
|
||
@Override | ||
public Tag createTag( | ||
String metalake, String name, String comment, Map<String, String> properties) { | ||
MetalakeInfo metalakeInfo = new MetalakeInfo(name, comment, properties, 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.
we should create a TagInfo
not MetalakeInfo
here
- Removed @SuppressWarnings annotations. - Removed unused OperationType. - Replaced MetalakeInfo with TagInfo. - Refactored TagFailureEvent constructor.
@@ -7,7 +7,7 @@ public class AlterTagFailureEvent extends TagFailureEvent { | |||
private final String name; | |||
private final TagChange[] changes; | |||
public AlterTagFailureEvent(String user, String metalake, String name, TagChange[] changes, Exception exception) { | |||
super(user, exception); | |||
super(user, null, exception); |
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 provide a meaning identifier to all failure event, for tag operations the resource identifier is the $metalake.$tagName, for list operations the the resource identifier is the objects which supports list tags, such as $metalake.$metadataObject in listTagsForMetadataObject
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.
Ok
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.
Do I need to replace all String metalake in the TagDispatcher interface, as well as the fields that have been replaced with NameIdentifier in the TagManager, with NameIdentifier and construct the NameIdentifier in operations instead?
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.
what do you mean about Do I need to replace all String metalake in the TagDispatcher 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.
I mean, currently TagDispatcher's methods are passing metalake as a String, and then turn it to NameIdentifier in TagManager.
I'm asking about if I should turn it to NameIdentifier earlier in TagOperations and then pass it through event and manager.
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 perfer not changing the interfaces in 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.
Ok
event describes what happened to a resource identified by a nameIdentifier,
|
core/src/main/java/org/apache/gravitino/listener/api/event/AlterTagFailureEvent.java
Show resolved
Hide resolved
...java/org/apache/gravitino/listener/api/event/AssociateTagsForMetadataObjectFailureEvent.java
Show resolved
Hide resolved
hi @FANNG1 Please help review this PR, thanks. |
core/src/main/java/org/apache/gravitino/listener/api/event/AlterTagFailureEvent.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/gravitino/listener/api/event/AlterTagFailureEvent.java
Outdated
Show resolved
Hide resolved
...java/org/apache/gravitino/listener/api/event/AssociateTagsForMetadataObjectFailureEvent.java
Outdated
Show resolved
Hide resolved
Could you fix the comments and could you add related document in |
OK |
This commit cleans up the TagFailureEvent classes by removing the unused 'metalake', 'name' and 'metadataObject'fields, along with their associated methods. This refactoring simplifies the code and enhances maintainability.
@FANNG1 Done, pls review thx |
@FANNG1 I run the Frontend IT test successfully in local, but it does not pass here 2 times, and it says connection timeout, do I need to change anything? |
no, it's network failures, reruned it. |
...main/java/org/apache/gravitino/listener/api/event/ListMetadataObjectsForTagFailureEvent.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/gravitino/listener/api/event/TagFailureEvent.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/gravitino/listener/api/event/TagFailureEvent.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/gravitino/listener/api/event/ListTagFailureEvent.java
Outdated
Show resolved
Hide resolved
@cool9850311 , LGTM except for minor comments, could you fix it? |
LGTM, @jerryshao do you have time to review again? |
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.
LGTM.
…#5944) ### What changes were proposed in this pull request? Add tag failure event to Gravitino server ### Why are the changes needed? Subtask: apache#5902 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Unit tests.
What changes were proposed in this pull request?
Add tag failure event to Gravitino server
Why are the changes needed?
Subtask: #5902
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Unit tests.