unknowntpo commented on code in PR #8190:
URL: https://github.com/apache/gravitino/pull/8190#discussion_r2288198701
##########
core/src/main/java/org/apache/gravitino/cache/CaffeineEntityCache.java:
##########
@@ -330,6 +349,32 @@ private <KEY, VALUE> Caffeine<KEY, VALUE>
newBaseBuilder(Config cacheConfig) {
return (Caffeine<KEY, VALUE>) builder;
}
+ private NameIdentifier getNameIdentifier(Entity entity) {
+ NameIdentifier nameIdent =
+ NameIdentifier.of(((HasIdentifier) entity).namespace(),
((HasIdentifier) entity).name());
+ return nameIdent;
+ }
+
+ private EntityCacheKey makeEntityCacheKey(Entity entity) {
+ NameIdentifier nameIdent = getNameIdentifier(entity);
+ EntityCacheKey entityCacheKey = EntityCacheKey.of(nameIdent,
entity.type());
+ return entityCacheKey;
+ }
+
+ public void putReverseIndex(Entity entity, EntityCacheRelationKey key) {
Review Comment:
After doing some research, I think we should keep this as is for now,
because changing generic type parameter involves changing these file:
`BaseEntityCache`, `CaffeineEntityCache`, `EntityCache`,
`NoOpsCache`,`SupportsEntityStoreCache`, `SupportsRelationEntityCache`,
`TestCaffeineEntityCache`,
Let's focus on the correctness of cache for now.
--
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]