Ensure JDK 17 support.

The cache-chroniclemap internals are JDK 17 compatible however JDK,
since that version is more restrictive on which modules are by default
accessible to the third party libraries. Enhance plugin's README.md
and build.md with steps that are necessary to run module in Gerrit
under JDK 17 JVM and call test from IDE (as described in [1]).

In addition JDK 17 modifies the way how annotations have their
`toString` method implemented. In JDK 11 (and older) it used to be:

  @com.google.inject.name.Named(value="accounts")

Whereas in JDK 17 it is:

  @com.google.inject.name.Named("accounts")

Modify MigrateH2CachesLocalDiskIT.isClassBoundWithName(Entry) to be
compatible with both implementations.

[1] https://chronicle.software/chronicle-support-java-17/

Bug: Issue 306464780
Change-Id: I3e201d9638de7007aca2af10796a8ee1deb9d04c
4 files changed
tree: 21cad605b6d534bd8dd947982eb300040276fc5e
  1. src/
  2. .gitignore
  3. BUILD
  4. external_plugin_deps.bzl
  5. Jenkinsfile
  6. LICENSE
  7. README.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

Note that in order to run on JDK 17 (or newer) the following parameters needs to be added to $GERRIT_SITE/etc/gerrit.config:

[container]
  javaOptions = --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED
  javaOptions = --add-exports=java.base/sun.nio.ch=ALL-UNNAMED
  javaOptions = --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
  javaOptions = --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
  javaOptions = --add-opens=jdk.compiler/com.sun.tools.javac=ALL-UNNAMED
  javaOptions = --add-opens=java.base/java.lang=ALL-UNNAMED
  javaOptions = --add-opens=java.base/java.lang.reflect=ALL-UNNAMED
  javaOptions = --add-opens=java.base/java.io=ALL-UNNAMED
  javaOptions = --add-opens=java.base/java.util=ALL-UNNAMED

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.