jerryshao commented on code in PR #7330:
URL: https://github.com/apache/gravitino/pull/7330#discussion_r2127002272
##########
core/src/main/java/org/apache/gravitino/GravitinoEnv.java:
##########
@@ -427,6 +439,10 @@ private void initBaseComponents() {
private void initGravitinoServerComponents() {
// Initialize EntityStore
this.entityStore = EntityStoreFactory.createEntityStore(config);
+ if (config.get(Configs.CACHE_ENABLED)) {
+ this.entityCache = CaffeineEntityCache.getInstance(config, entityStore);
+ // TODO constructs a CachedEntityStore instance with the entityStore and
entityCache
+ }
Review Comment:
BTW, the `entityCache` will be null if the cache is not enabled. From my
point, we should not create a `null` object deliberately, this will make it
hard for the downstream developer to use this object, they have to check if
this cache is null or not, and it is not a good implementation.
If the cache is not enabled, we should directly pass through to the entity
store call. So for the users of this cache, they can directly use it without
needing to add more check.
--
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]