yuqi1129 commented on code in PR #12006:
URL: https://github.com/apache/gravitino/pull/12006#discussion_r3670710992


##########
core/src/main/java/org/apache/gravitino/cache/CaffeineEntityCache.java:
##########
@@ -30,34 +30,39 @@
 import com.googlecode.concurrenttrees.radix.ConcurrentRadixTree;
 import com.googlecode.concurrenttrees.radix.RadixTree;
 import 
com.googlecode.concurrenttrees.radix.node.concrete.DefaultCharArrayNodeFactory;
-import java.util.ArrayDeque;
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Objects;
 import java.util.Optional;
-import java.util.Queue;
 import java.util.Set;
 import java.util.concurrent.ArrayBlockingQueue;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
-import org.apache.commons.lang3.ArrayUtils;
-import org.apache.commons.lang3.StringUtils;
 import org.apache.gravitino.Config;
 import org.apache.gravitino.Configs;
 import org.apache.gravitino.Entity;
 import org.apache.gravitino.HasIdentifier;
 import org.apache.gravitino.NameIdentifier;
-import org.apache.gravitino.SupportsRelationOperations;
-import org.apache.gravitino.meta.GenericEntity;
 import org.apache.gravitino.meta.ModelVersionEntity;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-/** This class implements the {@link org.apache.gravitino.cache.EntityCache} 
using Caffeine */
+/**
+ * This class implements the {@link org.apache.gravitino.cache.EntityCache} 
using Caffeine.
+ *
+ * <p>The cache stores one entry per entity, keyed by the entity's {@code 
NameIdentifier} and type.
+ * A radix-tree prefix index over the cache keys implements cascading removal: 
invalidating an
+ * entity also drops every cached descendant entry (e.g. invalidating a 
catalog drops the cached
+ * schemas and tables under it).
+ *
+ * <p>Relation query results are NOT cached by this implementation; relation 
and list operations
+ * always fall back to the {@code EntityStore}. Entity types whose 
materialized form embeds
+ * relation-derived data ({@code USER}, {@code GROUP}, {@code ROLE}) are 
excluded from caching
+ * entirely, because without relation tracking their entries could not be 
invalidated when the
+ * referenced entities change.
+ */
 public class CaffeineEntityCache extends BaseEntityCache {

Review Comment:
   OK



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