adutra commented on code in PR #4625:
URL: https://github.com/apache/polaris/pull/4625#discussion_r3382702466


##########
runtime/service/src/main/java/org/apache/polaris/service/events/PolarisEventListeners.java:
##########
@@ -82,6 +74,28 @@ public void onStartup(@Observes StartupEvent event) {
     }
   }
 
+  private static EnumSet<PolarisEventType> resolveSupportedTypes(
+      PolarisEventListenerConfiguration.ListenerConfiguration 
listenerConfiguration) {
+    // Missing or empty per-listener filters mean that the listener receives 
all event types.
+    if (listenerConfiguration == null
+        || (listenerConfiguration.enabledEventCategories().isEmpty()
+            && listenerConfiguration.enabledEventTypes().isEmpty())) {
+      return EnumSet.allOf(PolarisEventType.class);

Review Comment:
   And while we're here, let's make the code resilient to SmallRye's 
weirdnesses:
   
   ```java
             listenerConfiguration == null
                     || 
(listenerConfiguration.enabledEventCategories().orElse(Set.of()).isEmpty()
                         && 
listenerConfiguration.enabledEventTypes().orElse(Set.of()).isEmpty())
   ```



##########
runtime/service/src/main/java/org/apache/polaris/service/events/PolarisEventListeners.java:
##########
@@ -82,6 +74,28 @@ public void onStartup(@Observes StartupEvent event) {
     }
   }
 
+  private static EnumSet<PolarisEventType> resolveSupportedTypes(
+      PolarisEventListenerConfiguration.ListenerConfiguration 
listenerConfiguration) {
+    // Missing or empty per-listener filters mean that the listener receives 
all event types.
+    if (listenerConfiguration == null
+        || (listenerConfiguration.enabledEventCategories().isEmpty()
+            && listenerConfiguration.enabledEventTypes().isEmpty())) {
+      return EnumSet.allOf(PolarisEventType.class);

Review Comment:
   And while we're here, let's make the code resilient to SmallRye's 
weirdnesses:
   
   ```java
   listenerConfiguration == null
           || 
(listenerConfiguration.enabledEventCategories().orElse(Set.of()).isEmpty()
               && 
listenerConfiguration.enabledEventTypes().orElse(Set.of()).isEmpty())
   ```



-- 
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