[ 
https://issues.apache.org/jira/browse/KAFKA-8020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16793179#comment-16793179
 ] 

Richard Yu commented on KAFKA-8020:
-----------------------------------

You have some good points. About the lifespan of the entries being inserted, as 
you mentioned, WindowStores has retention time (which would be used to 
determine the timestamp of when an entry expires). For Key Value entries, we 
will probably mark the entry's end timestamp as {{Long.MAX_VALUE}} to indicate 
that its lifetime is indefinite (although there is the potential to add a 
configuration here which sets the default lifespan of an key-value entry, not 
too sure if we should implement that though). So we will probably mix entries 
with unlimited and limited time spans in ThreadCache. 

> Consider changing design of ThreadCache 
> ----------------------------------------
>
>                 Key: KAFKA-8020
>                 URL: https://issues.apache.org/jira/browse/KAFKA-8020
>             Project: Kafka
>          Issue Type: Improvement
>          Components: streams
>            Reporter: Richard Yu
>            Priority: Major
>
> In distributed systems, time-aware LRU Caches offers a superior eviction 
> policy better than traditional LRU models, having more cache hits than 
> misses. In this new policy, if an item is stored beyond its useful lifespan, 
> then it is removed. For example, in {{CachingWindowStore}}, a window usually 
> is of limited size. After it expires, it would no longer be queried for, but 
> it potentially could stay in the ThreadCache for an unnecessary amount of 
> time if it is not evicted (i.e. the number of entries being inserted is few). 
> For better allocation of memory, it would be better if we implement a 
> time-aware LRU Cache which takes into account the lifespan of an entry and 
> removes it once it has expired.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to