jerryshao commented on code in PR #5110:
URL: https://github.com/apache/gravitino/pull/5110#discussion_r1800414396
##########
core/src/main/java/org/apache/gravitino/listener/api/EventListenerPlugin.java:
##########
@@ -95,17 +97,29 @@ enum Mode {
void stop() throws RuntimeException;
/**
- * Handles events generated after the completion of an operation.
Implementers are responsible for
- * processing these events, which may involve additional logic to respond to
the operation
- * outcomes.
+ * Handles events generated after the completion of an operation.
*
- * <p>This method provides a hook for post-operation event processing,
allowing plugins to react
- * or adapt based on the event details.
+ * <p>This method provides a hook for post-operation event processing, you
couldn't change the
+ * resource in the event.
*
- * @param event The event to be processed.
- * @throws RuntimeException Indicates issues encountered during event
processing.
+ * @param postEvent The post event to be processed.
+ * @throws RuntimeException Indicates issues encountered during event
processing, this has no
+ * affect to the operation.
*/
- void onPostEvent(Event event) throws RuntimeException;
+ default void onPostEvent(Event postEvent) throws RuntimeException {}
+
+ /**
+ * Handles pre events generated before the operation.
+ *
+ * <p>This method handles pre-operation events in SYNC or ASYNC mode, any
changes to resources in
+ * the event will inflect the subsequent operations.
+ *
+ * @param preEvent The pre event to be processed.
+ * @throws ForbiddenException The operation will be skipped if and only if
throwing {@code
+ * org.apache.gravitino.exceptions.ForbiddenException} and the event
listener is SYNC mode,
+ * the exception will be ignored in other conditions.
Review Comment:
Can you please explain about the exception here, how you handle this?
--
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]