Front CacheChronicleMap with a Guava cache

The initial implementation of persistent caches using
ChronicleMap did not use any Guava cache front-end, relying
on the speed of accessing data on disk and memory.

Unfortunately, the deserialisation of some entities
(e.g. change_notes) is very expensive in terms of CPU
and ChronicleMap does not store the binary objects as-is
but relies on in-memory serialisation of keys and values.
There are two problems caused by this:
- delay in reading the cache from memory
- high system load when accessing the cache

Use the same structure of the H2 persistent cache where
the loader is delegated to the retrieval and deserialisation
of the entities from ChronicleMap.

Amend the cache statistics and return the in-memory elements
and the ones stored on disk as separate values.

Bug: Issue 15036
Change-Id: I8dd602c20fcd621972b562fc2163fefc7240484a
13 files changed
tree: 9eb0cf6d8aed7cfcde391aeed394f2d24f187c4b
  1. .gitignore
  2. BUILD
  3. Jenkinsfile
  4. LICENSE
  5. README.md
  6. external_plugin_deps.bzl
  7. src/
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.

Migration from H2 caches

You can check how to migrate from H2 to chronicle-map here.