vchag commented on code in PR #2836:
URL: https://github.com/apache/polaris/pull/2836#discussion_r2464203127


##########
runtime/service/src/main/java/org/apache/polaris/service/events/jsonEventListener/aws/cloudwatch/AwsCloudWatchEventListener.java:
##########
@@ -151,28 +158,44 @@ void shutdown() {
     }
   }
 
+  @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
+  public record CloudWatchEvent(
+      String principal,
+      String realmId,
+      Collection<String> activatedRoles,
+      String eventType,
+      @JsonUnwrapped PolarisEvent event // flatten
+      ) {}
+
   @Override
-  protected void transformAndSendEvent(HashMap<String, Object> properties) {
-    properties.put("realm_id", 
callContext.getRealmContext().getRealmIdentifier());
-    properties.put("principal", securityContext.getUserPrincipal().getName());
-    properties.put(
-        "activated_roles", ((PolarisPrincipal) 
securityContext.getUserPrincipal()).getRoles());
-    // TODO: Add request ID when it is available
+  protected void 
transformAndSendEvent(IcebergRestCatalogEvents.AfterRefreshTableEvent event) {

Review Comment:
   Oh right. Lets introduce a new config for `aws-cloudwatch.event-types`. 



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