Releases: cache2k/cache2k
v2.6.1.Final "Cogee Beach"
This change log lists the changes since 2.6.0.Final.
Fixes and Improvements
- Timer: Reduce scheduler events
- Timer: Correct scheduling time if an earlier expiry is inserted. Maximum lag time criteria was not met in this case.
- Timer: Rare case if only one cache entry with TTL and regular updates is used, leeds to continuous increase of scheduling events
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.6.1.Final</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>cache2k-core</artifactId>
<version>2.6.1.Final</version>
<scope>runtime</scope>
</dependency>
For Gradle users:
def cache2kVersion = '2.6.1.Final'
dependencies {
implementation "org.cache2k:cache2k-api:${cache2kVersion}"
runtimeOnly "org.cache2k:cache2k-core:${cache2kVersion}"
}
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.6.1.Final</version>
<scope>runtime</scope>
</dependency>
For Gradle users:
dependencies {
runtimeOnly "org.cache2k:cache2k-jcache:2.6.1.Final"
}
Implementation details, tuning tips and hints on configuration can be found at: JCache - cache2k User Guide
v2.6.0.Final "Cogee Beach"
This change log lists the changes since 2.4.1.Final.
New and Noteworthy
- Idle scan: an efficient expire after access / time to idle alternative, Github issue #39
- Lots of cleanup and housekeeping with some minor changes possibly breaking compatibility
- Test coverage improvement and removal of unused code
- Cache disable support, Github issue #74
- Continuous Android testing
Updated benchmarks comparing with Caffeine 3.0.5, and EHCache3 3.9.6
Possible breakages
Changes that may break existing applications.
- Spring support:
SpringCache2kManager.defaultSetup
throwsIllegalStateException
if not called before caches are added - Spring support:
SpringCache2kManager.defaultSetup
throwsIllegalStateException
if called twice EXPIRY_NOT_ETERNAL
constant removed fromCache2kConfig
- Fixed generic typing issues in
org.cache2k.config
package Sechduler.schedule
uses delay duration instead of absolute timeTimeReference.millis()
renamed toticks()
and additional conversion methods to support other time resolutions than milliseconds- Safety gap system property for sharp timeout changed to:
org.cache2k.sharpExpirySafetyGapMillis
- Removed capability to modify internal constants via
Tunable
- removed
SpringCache2kCacheManager.setCaches(Collection<Cache2kConfig<?, ?>> cacheConfigurationList)
- Corrected signature
BulkCacheLoader.BulkCallback.onLoadFailure(Set, Exception)
toonLoadFailure(Iterable, Exception)
Cache.expireAt()
andMutableCacheEntry.setExpiryTime()
: the maximum expiry time is capped by the specifiedexpireAfterWriteDuration
, this aligns the behavior with theExpiryPolicy
. The rationale is, that an (application) user, when settingexpireAfterWrite
expects that this duration is never exceeded.
API Changes
- Added
CacheClosedException
- Added
CacheEventListenerException
Fixes and Improvements
- Eviction improvements, minimal change to improve eviction, See issue comment
eternal(true/false)
/MutableEntry.setExpiryTime
: Expiry can be modified, although no other expiry setting is present, or in other words: the timer support is available by default. Ifeternal(true)
is configured, timer support is disabled andCache.invoke
/MutableEntry.setExpiryTime
orCache.expireAt
cannot be usedCache.invoke
/MutableEntry.setExpiryTime
: has no effect if entry is not existingCache.invoke
/MutableEntry.getExpiryTime
always returns positive time value- CI tests with Android API level 26 and API level 30
- Expiry timer: handle time values close up to
Long.MAX_VALUE - 1
without overflow - Support
Duration
for duration parameters in theCache2kBuilder
- Config section
InternalConfig
incache2k-core
for specific tuning values that should not be exposed in the public API - Spring support:
SpringCache2kManager.setDefaultCacheNames()
added - Spring support:
SpringCache2kManager.addCache(String, Function)
- Spring support:
SpringCache2kCacheManager.getCache
aligned with interface contract: returnsnull
if unknown cache name is requested CacheClosedListener
: Wait forCompletableFuture
- Simplify integrity checking, remove integrity state from toString output
- API: add/correct @nullable annotations in
ExpiryPolicy
andAsyncCacheLoader
Cache.invoke
: Set expiry time correctly for exception propagation, in casesetException
andsetExpiry
is used atomicallyCacheInfo.getExpiryAfterWriteTicks
,CacheInfo.getTimeReference()
: addedCacheControl.getCapacityLimit
returns maximum weight correctly when weigher is present- JCache: simplify implementation with access expiry and
Cache.getAll
- JCache: Corrected access expiry handling for
Cache.invoke
/Cache.invokeAll
Non Functional Improvements
- Some tests migrated to JUnit 5 and AspectJ
- Various documentation touch ups
- Documentation and examples for expiry and expiry policy
- Examples for expiry policy in
ExpiryPolicyExampleTest
unit test - Documentation improvements, fixed many typos and grammar errors in the API package
Credits
- Marcel Schnelle, mannodermaus for the contribution of Android CI tests, PR#178
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.6.0.Final</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>cache2k-core</artifactId>
<version>2.6.0.Final</version>
<scope>runtime</scope>
</dependency>
For Gradle users:
def cache2kVersion = '2.6.0.Final'
dependencies {
implementation "org.cache2k:cache2k-api:${cache2kVersion}"
runtimeOnly "org.cache2k:cache2k-core:${cache2kVersion}"
}
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.6.0.Final</version>
<scope>runtime</scope>
</dependency>
For Gradle users:
dependencies {
runtimeOnly "org.cache2k:cache2k-jcache:2.6.0.Final"
}
Implementation details, tuning tips and hints on configuration can be found at: JCache - cache2k User Guide
v2.5.3.Beta "Cogee Beach"
This is a preview release for evaluation purposes and should not be used in production. The final release is planed as "Cogee Beach" - 2.6.0.Final.
API Change
- Added
CacheClosedException
, moved fromorg.cache2k.core
Fixes and Improvements
CacheClosedListener
: Wait forCompletableFuture
- Simplify integrity checking, remove integrity state from toString output
- API: add/correct
@Nullable
annotations inExpiryPolicy
andAsyncCacheLoader
Cache.invoke
: Set expiry time correctly for exception propagation, in casesetException
andsetExpiry
is used atomicallyCacheInfo.getExpiryAfterWriteTicks
,CacheInfo.getTimeReference()
: added
Possible breakages
Cache.expireAt()
andMutableCacheEntry.setExpiryTime()
: the maximum expiry time is capped by the specifiedexpireAfterWriteDuration
, this aligns the behavior with theExpiryPolicy
. The rationale is, that an (application) user, when settingexpireAfterWrite
expects that this duration is never exceeded.CacheControl.getCapacityLimit
returns maximum weight correctly when weigher is present
v2.5.2.Alpha "Cogee Beach"
This is a preview release for evaluation purposes and should not be used in production.
The final release is planed as "Cogee Beach" - 2.6.0.Final.
Fixes and Improvements
eternal(true/false)
/MutableEntry.setExpiryTime
: Expiry can be modified, although no other expiry setting is present, or in other words: the timer support is available by default. Ifeternal(true)
is configured, timer support is disabled and
Cache.invoke
/MutableEntry.setExpiryTime
orCache.expireAt
cannot be usedCache.invoke
/MutableEntry.setExpiryTime
: has no effect if entry is not existingCache.invoke
/MutableEntry.getExpiryTime
always returns positive time value- CI tests with Android API level 26 and API level 30
- Expiry: handle time values close to
Long.MAX_VALUE
without overflow, although the application should not produce these. - Support
Duration
for duration parameters in theCache2kBuilder
- Config section
InternalConfig
incache2k-core
for specific tuning values that should not be exposed in the public API - Spring support:
SpringCache2kDefaultSupplier
provides default setup and manager context - Spring support:
SpringCache2kManager.setDefaultCacheNames()
added - Spring support:
SpringCache2kManager.addCache(String, Function)
- Spring support: added
SpringCache2kDefaultCustomizer
- Corrected signature
BulkCacheLoader.BulkCallback.onLoadFailure(Set, Exception)
to onLoadFailure(Iterable, Exception)
Possible breakages
Changes that may break existing applications.
- Spring support:
SpringCache2kManager.defaultSetup
throwsIllegalStateException
if not called before caches are added EXPIRY_NOT_ETERNAL
constant removed fromCache2kConfig
- Fixed generic typing issues in
org.cache2k.config
package Sechduler.schedule
uses delay duration instead of absolute timeTimeReference.millis()
renamed toticks()
and additional conversion methods to support- other time resolutions than milliseconds
- Safety gap system property for sharp timeout changed to:
org.cache2k.sharpExpirySafetyGapMillis
- Removed capability to modify internal constants via
Tunable
- removed
SpringCache2kCacheManager.setCaches(Collection<Cache2kConfig<?, ?>> cacheConfigurationList)
Non Functional Improvements
- Started with tests based on JUnit 5
- Documentation and examples for expiry, expiry policy
- Documentation improvements, fixed many typos and grammar errors in the API package
Credits
- Marcel Schnelle, mannodermaus for the contribution of Android CI tests, PR#178
v2.5.1.Alpha - "Cogee Beach"
This is a preview release for evaluation purposes and should not be used in production. The final release is planed as "Cogee Beach" - 2.6.0.Final.
Fixes and Improvements
- Documentation touch ups
- Cache disable support, Github issue #74
- Eviction improvements, minimal change to improve eviction, See issue comment
- Examples for expiry policy in
ExpiryPolicyExampleTest
unit test - Idle scan: a more efficient expire after access / time to idle alternative, Github issue #39
v2.4.1.Final "Port Philip"
This change log lists the changes since 2.4.0.Final.
Fixes and Improvements
- Improve exception handling when async callbacks are completed after the cache is closed, GH#175
- Fix wrong links to the documentation
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.4.1.Final</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>cache2k-core</artifactId>
<version>2.4.1.Final</version>
<scope>runtime</scope>
</dependency>
For Gradle users:
def cache2kVersion = '2.4.1.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.4.1.Final</version>
<scope>runtime</scope>
</dependency>
For Gradle users:
dependencies {
runtimeOnly "org.cache2k:cache2k-jcache:2.4.1.Final"
}
Implementation details, tuning tips and hints on configuration can be found at: JCache - cache2k User Guide
v2.4.0.Final "Port Philip"
This change log lists the changes since 2.2.1.Final.
New and Noteworthy
This targets details to improve performance of big caches in multi core environments and minimizing the CPU impact on monitoring and frequent statistic polls.
Updated benchmarks comparing with Caffeine 3.0.4, and EHCache3 3.9.6
Fixes and Improvements
- Change default entry capacity to 1802. When the capacity is reported to a monitoring system or otherwise analysed, this serves as a magic number to indicate that the cache capacity is essentially not configured intentionally
- Improved hit counter accuracy for statistics, see: #150
- Improved statistics retrieval. When requesting the statistics, e.g. for micrometer export, no expensive operations are performed any more and no cache wide locking is done. In consequence statistics can be retrieved more frequently without big effect on the running application. Since there is no cache wide lock, statistics counters can have inconsistencies, e.g. the inserted and removed entries might not match exactly with the current size.
- Eviction throughput improvement. The Clock-Pro ghost/history table is limited to 3K entries. Profiling showed that the big ghost table attributed to lower performance with bigger cache sizes (1 million entries) and did not contribute significantly to a better hitrate.
- Various code quality improvements
API Breakages
MutableCacheEntry.getValueOrNull
: removed, since wrongly introduced in version 2.0.
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.4.0.Final</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>cache2k-core</artifactId>
<version>2.4.0.Final</version>
<scope>runtime</scope>
</dependency>
For Gradle users:
def cache2kVersion = '2.4.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.4.0.Final</version>
<scope>runtime</scope>
</dependency>
For Gradle users:
dependencies {
runtimeOnly "org.cache2k:cache2k-jcache:2.4.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
v2.3.1.Alpha "Port Philip"
This is a preview release for evaluation purposes and should not be used in production. The final release is planed as "Port Philip" - 2.4.0.Final.
Fixes and Improvements
- Improved hit counter accuracy for statistics, see: #150
- Improved statistics retrieval. When requesting the statistics, e.g. for micrometer export, no expensive operations are performed any more and no cache wide locking is done. In consequence statistics can be retrieved more frequently without big effect on the running application. Since there is no cache wide lock, statistics counters can have inconsistencies, e.g. the inserted and removed entries might not match exactly with the current size.
- Eviction throughput improvement. The Clock-Pro ghost/history table is limited to 3K entries. Profiling showed that the big ghost table attributed to lower performance with bigger cache sizes (1 million entries) and did not contribute significantly to a better hitrate.
- Various code quality improvements
v2.2.1.Final "Twofold Bay"
This change log lists the changes since 2.2.0.Final.
Fixes and Improvements
Cache.entries
: throwsIlliegalStateException
ifremove
is called twice on the iterator.Cache.asMap
: aligned to the map contract,equals
,hashCode
cooperate with arbitrary maps,
toString
is implemented identical to Java maps (e.g. HashMap)
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.1.Final</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>cache2k-core</artifactId>
<version>2.2.1.Final</version>
<scope>runtime</scope>
</dependency>
Recommended for Gradle users:
def cache2kVersion = '2.2.1.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.1.Final</version>
<scope>runtime</scope>
</dependency>
For Gradle users:
dependencies {
runtimeOnly "org.cache2k:cache2k-jcache:2.2.1.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
v2.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
BulkCacheLoader
andAsyncBulkCacheLoader
which are used by the cache operationsgetAll
,loadAll
,reloadAll
andinvokeAll
. 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.
TheCoalescingBulkLoader
resides 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.integration
package - Remove deprecated methods
Cache.loadAll
,Cache.reloadAll
withCacheOperationCompletionListener
- Remove deprecated classes
AdvancedKeyValueSource
,KeyValueStore
- The deprecation flag for
expireAt
is removed. We keep this method - Remove unused
org.cache2k.spi.Cache2kExtensionProvider
Fixes and Improvements
- cache2k-api / Modules: export
org.cache2k.annotation
forNullable
etc.
Improved new bulk loader support. - Improve entry processor performance, GH#170
- Consistent exception handling for
Cache.computeIfAbsent
, GH#171 - Support for
AutoClosable
for async loaders Cache.asMap()
: Align exception handlingcomputeIfPresent
,compute
withConcurrentMap
contract
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