flyrain commented on code in PR #3195:
URL: https://github.com/apache/polaris/pull/3195#discussion_r2593885858


##########
runtime/service/src/main/java/org/apache/polaris/service/events/PolarisEventType.java:
##########
@@ -125,8 +125,8 @@ public enum PolarisEventType {
   AFTER_RENAME_TABLE,
   BEFORE_UPDATE_TABLE,
   AFTER_UPDATE_TABLE,
-  BEFORE_COMMIT_TABLE,
-  AFTER_COMMIT_TABLE,
+  BEFORE_COMMIT_TABLE, // REMOVED FROM SOURCE CODE
+  AFTER_COMMIT_TABLE, // REMOVED FROM SOURCE CODE

Review Comment:
   That's a valid concern. I'm OK to remove it as this is preview feature, but 
it requires notice. Another option is to adding code field to explicitly set a 
number for the type. This is more robust so that it prevents any developer 
adding an event in the middle and accidentally break downstreams. It isn't a 
blocker for this PR though. Can you file an issue for this? 
   
   Something like:
   ```
   public enum EventType {
       AFTER_UPDATE(101),
       AFTER_DELETE(102);
   
       private final int code;
   
       EventType(int code) {
           this.code = code;
       }
   
       public int code() {
           return code;
       }
   }
   ```
   Adding a constructor will prevent accidental ordinal changes and make future 
evolution safer. Given the downstream relies on the event type, I think it's 
reasonable to add a explicit 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]

Reply via email to