liunaijie commented on code in PR #7600:
URL: https://github.com/apache/gravitino/pull/7600#discussion_r2191589169
##########
core/src/main/java/org/apache/gravitino/cache/EntityCacheKey.java:
##########
@@ -138,7 +138,7 @@ public int hashCode() {
*/
@Override
public String toString() {
- String stringExpr = identifier.toString() + ":" + type.getShortName();
+ String stringExpr = identifier.toString() + ":" + type.toString();
Review Comment:
In the `CaffeineEntityCache` class. when addCache, it will put data to
`cacheData` (this struct store the data) and add key to `cacheIndex` struct
(use EntityCache,toString as key).
So if without type suffix, there will be a edge case. like this UT
(https://github.com/apache/gravitino/blob/main/core/src/test/java/org/apache/gravitino/cache/TestCaffeineEntityCache.java#L229)
. cache store 2 entities, but the size return 1.
Update here use `type.toString` as suffix
Refer:
https://github.com/apache/gravitino/blob/main/core/src/main/java/org/apache/gravitino/cache/CaffeineEntityCache.java#L295
--
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]