adutra commented on code in PR #2998:
URL: https://github.com/apache/polaris/pull/2998#discussion_r2524705215
##########
runtime/service/src/main/java/org/apache/polaris/service/admin/PolarisCatalogsEventServiceDelegator.java:
##########
@@ -51,37 +53,50 @@ public class PolarisCatalogsEventServiceDelegator
implements PolarisCatalogsApiS
@Inject @Delegate PolarisCatalogsApiService delegate;
@Inject PolarisEventListener polarisEventListener;
+ @Inject PolarisEventMetadataFactory eventMetadataFactory;
@Override
public Response createCatalog(
CreateCatalogRequest request, RealmContext realmContext, SecurityContext
securityContext) {
polarisEventListener.onBeforeCreateCatalog(
- new
CatalogsServiceEvents.BeforeCreateCatalogEvent(request.getCatalog().getName()));
+ new CatalogsServiceEvents.BeforeCreateCatalogEvent(
+ PolarisEvent.createEventId(),
Review Comment:
The more I think about this the more I think we shouldn't move the id to the
metadata. Here is what the `PolarisEventMetadata` would look like:
```java
@PolarisImmutable
public interface PolarisEventMetadata {
UUID id();
// other methods omitted for brevity
}
```
But that creates an ambiguity: is `id()` the identifier of the metadata
object, or of the event object?
I could rename it to `eventId()` of course, but it still doesn't feel right
to me. An identifier should be attach to the object it identifies.
##########
runtime/service/src/main/java/org/apache/polaris/service/admin/PolarisCatalogsEventServiceDelegator.java:
##########
@@ -51,37 +53,50 @@ public class PolarisCatalogsEventServiceDelegator
implements PolarisCatalogsApiS
@Inject @Delegate PolarisCatalogsApiService delegate;
@Inject PolarisEventListener polarisEventListener;
+ @Inject PolarisEventMetadataFactory eventMetadataFactory;
@Override
public Response createCatalog(
CreateCatalogRequest request, RealmContext realmContext, SecurityContext
securityContext) {
polarisEventListener.onBeforeCreateCatalog(
- new
CatalogsServiceEvents.BeforeCreateCatalogEvent(request.getCatalog().getName()));
+ new CatalogsServiceEvents.BeforeCreateCatalogEvent(
+ PolarisEvent.createEventId(),
Review Comment:
The more I think about this the more I think we shouldn't move the id to the
metadata. Here is what the `PolarisEventMetadata` would look like:
```java
@PolarisImmutable
public interface PolarisEventMetadata {
UUID id();
// other methods omitted for brevity
}
```
But that creates an ambiguity: is `id()` the identifier of the metadata
object, or of the event object?
I could rename it to `eventId()` of course, but it still doesn't feel right
to me. An identifier should be attached to the object it identifies.
--
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]