ajantha-bhat commented on a change in pull request #3653: [CARBONDATA-3665] 
Support TimeBased Cache expiration using ExpiringMap
URL: https://github.com/apache/carbondata/pull/3653#discussion_r390850841
 
 

 ##########
 File path: 
core/src/main/java/org/apache/carbondata/core/cache/CarbonLRUCache.java
 ##########
 @@ -95,9 +97,9 @@ public CarbonLRUCache(String propertyName, String 
defaultPropertyName) {
    * initialize lru cache
    */
   private void initCache() {
-    lruCacheMap =
-        new LinkedHashMap<String, 
Cacheable>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE, 1.0f,
-            true);
+    expiringMap =
+        
ExpiringMap.builder().expirationPolicy(ExpirationPolicy.ACCESSED).variableExpiration()
 
 Review comment:
   Add a comment about ExpirationPolicy.ACCESSED because expiry is based on the 
last access not based on the creation time.
   And setting to variable expiration as each entry can have its own expiry 
time.
   

----------------------------------------------------------------
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

Reply via email to