singhpk234 commented on code in PR #2480:
URL: https://github.com/apache/polaris/pull/2480#discussion_r2326120030


##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergRestCatalogEventServiceDelegator.java:
##########
@@ -103,8 +202,29 @@ public Response createTable(
       String accessDelegationMode,
       RealmContext realmContext,
       SecurityContext securityContext) {
-    return delegate.createTable(
-        prefix, namespace, createTableRequest, accessDelegationMode, 
realmContext, securityContext);
+    String catalogName = prefixParser.prefixToCatalogName(realmContext, 
prefix);
+    if (!createTableRequest.stageCreate()) {

Review Comment:
   why don't we emit anything for StageCreate ? 



##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergRestCatalogEventServiceDelegator.java:
##########
@@ -273,10 +477,21 @@ public Response replaceView(
       CommitViewRequest commitViewRequest,
       RealmContext realmContext,
       SecurityContext securityContext) {
-    return delegate.replaceView(
-        prefix, namespace, view, commitViewRequest, realmContext, 
securityContext);
+    String catalogName = prefixParser.prefixToCatalogName(realmContext, 
prefix);
+    polarisEventListener.onBeforeReplaceView(
+        new BeforeReplaceViewEvent(catalogName, namespace, view, 
commitViewRequest));
+    Response resp =
+        delegate.replaceView(
+            prefix, namespace, view, commitViewRequest, realmContext, 
securityContext);
+    polarisEventListener.onAfterReplaceView(
+        new AfterReplaceViewEvent(
+            catalogName, namespace, view, (LoadViewResponse) 
resp.getEntity()));
+    return resp;
   }
 
+  /**
+   * Table Committed Events are already instrumented at a more granular level 
than the API itself.
+   */

Review Comment:
   how and why , are it we tracking it per table ?? this seems like it doesn't 
follow the pattern 
   -- BeforEvent 
   -- do Something 
   -- After Event



##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergRestCatalogEventServiceDelegator.java:
##########
@@ -212,8 +384,12 @@ public Response listViews(
       Integer pageSize,
       RealmContext realmContext,
       SecurityContext securityContext) {
-    return delegate.listViews(
-        prefix, namespace, pageToken, pageSize, realmContext, securityContext);
+    String catalogName = prefixParser.prefixToCatalogName(realmContext, 
prefix);
+    polarisEventListener.onBeforeListViews(new 
BeforeListViewsEvent(catalogName, namespace));

Review Comment:
   are the nested namespace encoded by '%1F' in the final even ? 



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