unknowntpo commented on code in PR #8190:
URL: https://github.com/apache/gravitino/pull/8190#discussion_r2286834736
##########
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:
All entities in cache has the type: `<E extends Entity & HasIdentifier>`,
not `Entity`.
So it should be like this:
```
public <E extends Entity & HasIdentifier> void putReverseIndex(E entity,
EntityCacheRelationKey key) {
```
--
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]