lasdf1234 commented on code in PR #11882:
URL: https://github.com/apache/gravitino/pull/11882#discussion_r3733175335


##########
core/src/main/java/org/apache/gravitino/storage/relational/service/UserMetaService.java:
##########
@@ -472,4 +473,42 @@ public boolean deleteUserById(String metalake, long 
userId) {
                         userId, Entity.EntityType.USER.name())));
     return true;
   }
+
+  @Monitored(
+      metricsSource = GRAVITINO_RELATIONAL_STORE_METRIC_NAME,
+      baseMetricName = "countUsersByMetalake")
+  public long countUsersByMetalake(String metalakeName) {
+    Long count =
+        SessionUtils.getWithoutCommit(
+            UserMetaMapper.class, mapper -> 
mapper.countUserMetasByMetalakeName(metalakeName));
+    return count == null ? 0L : count;

Review Comment:
   The verification of Metalake has already been carried out at the manager 
level.



##########
core/src/main/java/org/apache/gravitino/storage/relational/service/GroupMetaService.java:
##########
@@ -484,4 +485,42 @@ public boolean deleteGroupById(String metalake, long 
groupId) {
                         groupId, Entity.EntityType.GROUP.name())));
     return true;
   }
+
+  @Monitored(
+      metricsSource = GRAVITINO_RELATIONAL_STORE_METRIC_NAME,
+      baseMetricName = "countGroupsByMetalake")
+  public long countGroupsByMetalake(String metalakeName) {
+    Long count =
+        SessionUtils.getWithoutCommit(
+            GroupMetaMapper.class, mapper -> 
mapper.countGroupMetasByMetalakeName(metalakeName));
+    return count == null ? 0L : count;

Review Comment:
   The verification of Metalake has already been carried out at the manager 
level.



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