roryqi commented on code in PR #9896:
URL: https://github.com/apache/gravitino/pull/9896#discussion_r2787725005


##########
server-common/src/main/java/org/apache/gravitino/server/authorization/MetadataAuthzHelper.java:
##########
@@ -328,12 +347,20 @@ private static void checkExecutor() {
 
   private static void preloadToCache(
       Entity.EntityType entityType, NameIdentifier[] nameIdentifiers) {
-    if (GravitinoEnv.getInstance().cacheEnabled()) {
-      if (entityType == Entity.EntityType.TABLE) {
-        GravitinoEnv.getInstance()
-            .entityStore()
-            .batchGet(nameIdentifiers, entityType, TableEntity.class);
-      }
+    if (!GravitinoEnv.getInstance().cacheEnabled()) {
+      return;
     }
+
+    // Only preload entity types that support batch get operations
+    if (!SUPPORTED_PRELOAD_ENTITY_TYPES.contains(entityType)) {
+      return;
+    }
+
+    GravitinoEnv.getInstance()
+        .entityStore()
+        .batchGet(
+            Arrays.asList(nameIdentifiers),
+            entityType,
+            EntityClassMapper.getEntityClass(entityType));
   }

Review Comment:
   We have authorization tests to test these.



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