Skip to content

Commit

Permalink
Extend lru cache to support cache entry expiration (facebookincubator…
Browse files Browse the repository at this point in the history
…#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
xiaoxmeng authored and facebook-github-bot committed May 26, 2024
1 parent 20afe68 commit abaf323
Show file tree
Hide file tree
Showing 14 changed files with 1,289 additions and 366 deletions.
1 change: 1 addition & 0 deletions velox/common/caching/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ target_link_libraries(
velox_file
velox_memory
velox_process
velox_time
Folly::folly
fmt::fmt
gflags::gflags
Expand Down
Loading

0 comments on commit abaf323

Please sign in to comment.