Evict cache entries when free space gets low

Chronicle-map cannot expand indefinitely, but only to an upper limit
which is based on the maxBloatFactor.

When the number of possible expansions drops to zero and the percentage
of free space in the last available segment falls under a configurable
threshold (percentageFreeSpaceEvictionThreshold), cold cache entries are
evicted from chronicle-map.

Hot entries are kept in an LRU in-memory cache that holds a configurable
fraction of the cache size.

A cold cache entry is an entry that does not belong to this hot-cache and
thus subject to eviction, in random order.

Bug: Issue 13536
Change-Id: Iaf94a041943fb0680c2e3a222f3adda19915ae19
8 files changed
tree: 2fedcc60c736ddaf7a6cb71de3dc6d2388110ef9
  1. src/
  2. .gitignore
  3. BUILD
  4. build.md
  5. config.md
  6. external_plugin_deps.bzl
  7. Jenkinsfile
  8. LICENSE
  9. README.md
  10. tuning.md
README.md

Persistent cache for Gerrit, based on ChronicleMap

Non-blocking and super-fast on-disk cache libModule for Gerrit Code Review based on ChronicleMap on-disk implementation.

How to build

This libModule is built like a Gerrit in-tree plugin, using Bazelisk. See the build instructions for more details.

Setup

  • Install cache-chronicalmap module

Install the chronicle-map module into the $GERRIT_SITE/lib directory.

Add the cache-chroniclemap module to $GERRIT_SITE/etc/gerrit.config as follows:

[gerrit]
  installModule = com.googlesource.gerrit.modules.cache.chroniclemap.ChronicleMapCacheModule

For further information and supported options, refer to config documentation.