xunliu commented on code in PR #8297:
URL: https://github.com/apache/gravitino/pull/8297#discussion_r2308708826


##########
core/src/main/java/org/apache/gravitino/cache/CaffeineEntityCache.java:
##########
@@ -78,11 +79,21 @@ public class CaffeineEntityCache extends BaseEntityCache {
   private static final Logger LOG = 
LoggerFactory.getLogger(CaffeineEntityCache.class.getName());
   private final ReentrantLock opLock = new ReentrantLock();
 
-  /** Cache part */
-  private final Cache<EntityCacheKey, List<Entity>> cacheData;
+  /** Cache data structure. cacheData[0] = Role1-KEY -> [catalog1, catalog2] */
+  private final Cache<EntityCacheRelationKey, List<Entity>> cacheData;
 
-  /** Index part */
-  private RadixTree<EntityCacheKey> cacheIndex;
+  /**
+   * Cache reverse index structure. cacheData[0] = Role1 -> [catalog1, 
catalog2] cacheData[1] =
+   * catalog1 -> [tab1, tab2] reverseIndex[0] = catalog1-KEY -> Role1 
reverseIndex[1] = catalog2-KEY
+   * -> Role1 reverseIndex[3] = tab1-KEY -> catalog1 reverseIndex[4] = 
tab2-KEY -> catalog1
+   */

Review Comment:
   I implement these function in the 
[core/src/main/java/org/apache/gravitino/cache/ReverseIndexRules.java](https://github.com/apache/gravitino/pull/8297/files/d0ffbcd742189f376e8b82e9bab1b9f5841300e1#diff-c154fd9a0c98634802b70e022b1268e7a77c3260c29908307b9266e968ccf98a)



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