cache2k 2.2.0.Final “Twofold Bay”
This change log lists the complete changes since the last stable version 2.0.0.Final.
New and Noteworthy
- Bulk support: New interfaces
BulkCacheLoaderandAsyncBulkCacheLoaderwhich are used by the cache operationsgetAll,loadAll,reloadAllandinvokeAll. The will get more optimizations and improvements in the next development releases. GH#166 CoalescingBulkLoader: combines multiple requests into a bulk requests or limits bulk requests to a maximum size. Recommended when using a bulk loader and refresh ahead. TheCoalescingBulkLoaderresides in the separate jarcache2k-addon.
Possible Breakages
Deprecated methods were removed (see below).
API changes
- Improve API of
Feature - Async loader: add cache to the load context
- Remove deprecated
org.cache2k.integrationpackage - Remove deprecated methods
Cache.loadAll,Cache.reloadAllwithCacheOperationCompletionListener - Remove deprecated classes
AdvancedKeyValueSource,KeyValueStore - The deprecation flag for
expireAtis removed. We keep this method - Remove unused
org.cache2k.spi.Cache2kExtensionProvider
Fixes and Improvements
- cache2k-api / Modules: export
org.cache2k.annotationforNullableetc. Improved new bulk loader support. - Improve entry processor performance, GH#170
- Consistent exception handling for
Cache.computeIfAbsent, GH#171 - Support for
AutoClosablefor async loaders Cache.asMap(): Align exception handlingcomputeIfPresent,computewithConcurrentMapcontract
Credits
Many thanks for the valuable input to the contributors of this release:
Using this cache2k version
The binaries are available on maven central.
For Java SE/EE and Android environments
For Maven users:
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>cache2k-api</artifactId>
<version>2.2.0.Final</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>cache2k-core</artifactId>
<version>2.2.0.Final</version>
<scope>runtime</scope>
</dependency>
Recommended for Gradle users:
def cache2kVersion = '2.2.0.Final'
dependencies {
implementation "org.cache2k:cache2k-api:${cache2kVersion}"
runtimeOnly "org.cache2k:cache2k-core:${cache2kVersion}"
}
Note to Android users: The included jar files contain code that might only be needed in server environments (e.g. JMX support). It is possible to strip unnecessary code. Example ProGuard rules can be found at Andriod - cache2k User Guide
Using the JCache / JSR107 provider
Maven users include the cache2k JCache provider this way:
<dependency>
<groupId>org.cache2k</groupId>
<artifactId>cache2k-jcache</artifactId>
<version>2.2.0.Final</version>
<scope>runtime</scope>
</dependency>
For Gradle users:
dependencies {
runtimeOnly "org.cache2k:cache2k-jcache:2.2.0.Final"
}
Implementation details, tuning tips and hints on configuration can be found at: [JCache - cache2k User Guide](https://cache2k.org/docs/latest/user-guide.html#jcache