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


##########
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:
   what is the on before and on after for this, would looks though ?



##########
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:
   But we are not emitting a onBeforeCreateTable too ? never the less what 
happens when i stage create and then do `/commit` ?  



##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergRestCatalogEventServiceDelegator.java:
##########
@@ -262,7 +480,13 @@ public Response renameView(
       RenameTableRequest renameTableRequest,
       RealmContext realmContext,
       SecurityContext securityContext) {
-    return delegate.renameView(prefix, renameTableRequest, realmContext, 
securityContext);
+    String catalogName = prefixParser.prefixToCatalogName(realmContext, 
prefix);
+    polarisEventListener.onBeforeRenameView(
+        new BeforeRenameViewEvent(catalogName, renameTableRequest));

Review Comment:
   no namespace here ? wouldn't it be nice to know namespace before after ? 



-- 
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: issues-unsubscr...@polaris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to