olsoloviov commented on code in PR #3293:
URL: https://github.com/apache/polaris/pull/3293#discussion_r2670536826


##########
runtime/service/src/main/java/org/apache/polaris/service/events/PolarisEvent.java:
##########
@@ -18,10 +18,66 @@
  */
 package org.apache.polaris.service.events;
 
-/** Represents an event emitted by Polaris. */
-public interface PolarisEvent {
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
 
-  PolarisEventType type();
+/**
+ * Represents an event emitted by Polaris. Events have a type, metadata, and a 
map of typed
+ * attributes. Use {@link #builder(PolarisEventType, PolarisEventMetadata)} to 
create instances.
+ */
+public record PolarisEvent(
+    PolarisEventType type, PolarisEventMetadata metadata, Map<AttributeKey<?>, 
Object> attributes) {

Review Comment:
   Thanks, that makes sense. It is not compatible with using Immutables on 
PolarisEvent though - putAttribute() will not be generated, so we will have to 
stick with manual builder.



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