arp7 commented on a change in pull request #1100: HDDS-1802. Add Eviction 
policy for table cache.
URL: https://github.com/apache/hadoop/pull/1100#discussion_r303692835
 
 

 ##########
 File path: 
hadoop-hdds/common/src/main/java/org/apache/hadoop/utils/db/TypedTable.java
 ##########
 @@ -83,11 +116,22 @@ public boolean isEmpty() throws IOException {
 
   @Override
   public boolean isExist(KEY key) throws IOException {
-    CacheValue<VALUE> cacheValue= cache.get(new CacheKey<>(key));
-    return (cacheValue != null && cacheValue.getCacheValue() != null) ||
+
+    if (cacheCleanupPolicy == TableCacheImpl.CacheCleanupPolicy.NEVER) {
 
 Review comment:
   I understand why we added this policy-specific check here. However it is 
probably misplaced here. Your original solution to have two cache types with 
`isExist` overloaded was probably better.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to