jerryshao commented on code in PR #5110:
URL: https://github.com/apache/gravitino/pull/5110#discussion_r1800412895
##########
core/src/main/java/org/apache/gravitino/listener/EventListenerPluginWrapper.java:
##########
@@ -68,13 +70,40 @@ public void onPostEvent(Event event) {
userEventListener.onPostEvent(event);
} catch (Exception e) {
LOG.warn(
- "Event listener {} process event {} failed,",
+ "Event listener {} process post event {} failed,",
listenerName,
event.getClass().getSimpleName(),
e);
}
}
+ @Override
+ public void onPreEvent(PreEvent preEvent) {
+ try {
+ userEventListener.onPreEvent(preEvent);
+ } catch (ForbiddenException e) {
+ if (Mode.SYNC.equals(mode())) {
+ LOG.warn(
+ "Event listener {} process pre event {} failed, will skip the
operation.",
+ listenerName,
+ preEvent.getClass().getSimpleName(),
+ e);
Review Comment:
I think you can extract the common part here to simplify the code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]