yuqi1129 commented on code in PR #8712:
URL: https://github.com/apache/gravitino/pull/8712#discussion_r2541632660
##########
core/src/main/java/org/apache/gravitino/cache/CaffeineEntityCache.java:
##########
@@ -222,10 +282,12 @@ public <E extends Entity & HasIdentifier> void put(
segmentedLock.withLock(
entityCacheKey,
() -> {
- // We still need to cache the entities even if the list is empty, to
avoid cache
- // misses. Consider the scenario where a user queries for an
entity's relations and the
- // result is empty. If we don't cache this empty result, the next
query will still hit the
- // backend, this is not desired.
+ // Return directly if entities are empty. No need to put an empty
list to cache, we will
+ // use another PR to resolve the performance problem.
+ if (entities.isEmpty()) {
+ return;
+ }
+
Review Comment:
It's a need, or CI will fail.
--
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]