mchades commented on code in PR #9068:
URL: https://github.com/apache/gravitino/pull/9068#discussion_r2517098287
##########
core/src/main/java/org/apache/gravitino/cache/CaffeineEntityCache.java:
##########
@@ -366,21 +366,29 @@ private boolean invalidateEntities(
Optional<SupportsRelationOperations.Type> relTypeOpt) {
Queue<EntityCacheKey> queue = new ArrayDeque<>();
- EntityCacheKey valueForExactKey =
+ EntityCacheRelationKey valueForExactKey =
cacheIndex.getValueForExactKey(
relTypeOpt.isEmpty()
- ? EntityCacheKey.of(identifier, type).toString()
+ ? EntityCacheRelationKey.of(identifier, type).toString()
: EntityCacheRelationKey.of(identifier, type,
relTypeOpt.get()).toString());
if (valueForExactKey == null) {
- // No key to remove
- return false;
+ // It means the key does not exist in the cache. However, we still need
to handle some cases.
+ // For example, we have store a role entity in the cache and entity to
role in the reverse
+ // index. This is: key -> role, reverse index: securable object -> role.
When will update the
+ // securable object, we need to invalidate the role from the cache even
the securable object
Review Comment:
what's the meaning of "When will update the view securable object"?
--
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]