adutra commented on code in PR #2962:
URL: https://github.com/apache/polaris/pull/2962#discussion_r2498410875
##########
runtime/service/src/main/java/org/apache/polaris/service/events/listeners/aws/cloudwatch/AwsCloudWatchConfiguration.java:
##########
@@ -86,4 +89,8 @@ public interface AwsCloudWatchConfiguration {
@WithName("synchronous-mode")
@WithDefault("false")
boolean synchronousMode();
+
+ @WithName("event-types")
+ Optional<Set<Class<? extends PolarisEvent>>>
Review Comment:
Yes this is possible. Here is an example:
```properties
polaris.event-listener.aws-cloudwatch.event-types=\
org.apache.polaris.service.events.IcebergRestCatalogEvents$BeforeCreateNamespaceEvent,\
org.apache.polaris.service.events.IcebergRestCatalogEvents$AfterCreateNamespaceEvent
```
See default converters here:
https://smallrye.io/smallrye-config/Main/config/getting-started/#converters
##########
runtime/defaults/src/main/resources/application.properties:
##########
@@ -144,6 +144,7 @@ polaris.event-listener.type=no-op
#
polaris.event-listener.aws-cloudwatch.log-stream=polaris-cloudwatch-default-stream
# polaris.event-listener.aws-cloudwatch.region=us-east-1
# polaris.event-listener.aws-cloudwatch.synchronous-mode=false
+# polaris.event-listener.aws-cloudwatch.event-types= // the absence of this
property would result in processing all Polaris event types.
Review Comment:
You may want to add an example of how to actually specify events here:
```suggestion
# The absence of the property below would result in processing all Polaris
event types (default).
# polaris.event-listener.aws-cloudwatch.event-types=\
#
org.apache.polaris.service.events.IcebergRestCatalogEvents$BeforeCreateNamespaceEvent,\
#
org.apache.polaris.service.events.IcebergRestCatalogEvents$AfterCreateNamespaceEvent
```
##########
runtime/service/src/main/java/org/apache/polaris/service/config/PolarisIcebergObjectMapperCustomizer.java:
##########
@@ -56,6 +61,10 @@ public void customize(ObjectMapper objectMapper) {
objectMapper.setVisibility(PropertyAccessor.FIELD,
JsonAutoDetect.Visibility.ANY);
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,
false);
objectMapper.setPropertyNamingStrategy(new
PropertyNamingStrategies.KebabCaseStrategy());
+ objectMapper.addMixIn(PolarisEvent.class, PolarisEventBaseMixin.class);
+ objectMapper.addMixIn(TableIdentifier.class,
IcebergMixins.TableIdentifierMixin.class);
Review Comment:
Good catch, `RESTSerializers` have serializers for `TableIdentifier` and
`Namespace` already.
--
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]