xunliu commented on code in PR #8297:
URL: https://github.com/apache/gravitino/pull/8297#discussion_r2307141942
##########
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
+ */
+ private ReverseIndexCache reverseIndex;
+
+ /**
+ * Cache Index structure. cacheData[0] = Role1 -> [catalog1, catalog2]
cacheData[1] = catalog1 ->
+ * [tab1, tab2] cacheIndex[0] = Role1-KEY -> Role1 cacheIndex[1] = Role1-KEY
-> Role1
Review Comment:
Remove invalid comments
--
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]