Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend lru cache to support cache entry expiration (facebookincubator…
…#9860) Summary: Extend simple LRU cache to support cache entry expiration for Meta internal remote storage throttling use case. It mainly replace folly simple cache with its own cache implementation so that we can customize the caching behavior. We are have two folly intrusive lists one for lru and the other expiration list for cache expiration. The lru list updated on each cache lookup according the data recency while expiration list is never updated and is positioned based on the cache insertion time. When create simple LRU cache, we need to configure the expiration timeout in milliseconds. If it is zero, then there is no cache expiration enforcement. Otherwise, we will check the expiration upon cache access, cache insertion and cache entry release. We will evict out an expired cache entry no matter how hot it is. Pull Request resolved: facebookincubator#9860 Reviewed By: Yuhta Differential Revision: D57691395 Pulled By: xiaoxmeng fbshipit-source-id: a7ca88fb245aefa0e8b2f8465ea5b6078d991277
- Loading branch information