orenccl commented on code in PR #5584:
URL: https://github.com/apache/gravitino/pull/5584#discussion_r1843534740


##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/rest/IcebergViewOperations.java:
##########
@@ -139,11 +185,49 @@ public Response viewExists(
       @PathParam("prefix") String prefix,
       @PathParam("namespace") String namespace,
       @PathParam("view") String view) {
-    TableIdentifier tableIdentifier = 
TableIdentifier.of(RESTUtil.decodeNamespace(namespace), view);
-    if 
(icebergCatalogWrapperManager.getOps(prefix).existView(tableIdentifier)) {
-      return IcebergRestUtils.noContent();
+    String catalogName = IcebergRestUtils.getCatalogName(prefix);
+    Namespace icebergNS = RESTUtil.decodeNamespace(namespace);
+    LOG.info(
+        "Check Iceberg view exists, catalog: {}, namespace: {}, table: {}",
+        catalogName,
+        icebergNS,
+        view);
+    IcebergRequestContext context = new 
IcebergRequestContext(httpServletRequest(), catalogName);
+    TableIdentifier viewIdentifier = TableIdentifier.of(icebergNS, view);
+    boolean exists = viewOperationDispatcher.viewExists(context, 
viewIdentifier);
+    if (exists) {
+      return IcebergRestUtils.okWithoutContent();
     } else {
       return IcebergRestUtils.notExists();
     }
   }
+
+  @POST
+  @Path("{view}/metrics")
+  @Produces(MediaType.APPLICATION_JSON)
+  @Timed(name = "report-view-metrics." + MetricNames.HTTP_PROCESS_DURATION, 
absolute = true)
+  @ResponseMetered(name = "report-table-metrics", absolute = true)
+  public Response reportTableMetrics(

Review Comment:
   Remove it!



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