jerryshao commented on code in PR #6485:
URL: https://github.com/apache/gravitino/pull/6485#discussion_r2178914385
##########
core/src/main/java/org/apache/gravitino/listener/EventBus.java:
##########
@@ -98,7 +103,27 @@ private void dispatchPostEvent(Event postEvent) {
eventListeners.forEach(eventListener ->
eventListener.onPostEvent(postEvent));
}
- private void dispatchPreEvent(PreEvent preEvent) throws ForbiddenException {
+ private Optional<BaseEvent> dispatchAndTransformPreEvent(PreEvent
originalEvent)
+ throws ForbiddenException {
+ boolean supportsChangePreEvent = originalEvent instanceof
SupportsChangingPreEvent;
+ PreEvent preEvent;
+ if (supportsChangePreEvent) {
+ preEvent = (PreEvent) transformPreEvent((SupportsChangingPreEvent)
originalEvent);
+ } else {
+ preEvent = originalEvent;
+ }
eventListeners.forEach(eventListener ->
eventListener.onPreEvent(preEvent));
+ if (supportsChangePreEvent) {
+ return Optional.of(preEvent);
+ }
+ return Optional.empty();
+ }
Review Comment:
Can you change to ` return xxx ? foo : bar`?
--
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]