Changelog History
Page 1
-
v1.9.5.Beta Changes
December 11, 2020๐ This is a preview release for evaluation purposes and should not be used in production.
The preview is in preparation for version 2 which will have some major breaking
changes to the previous releases. The final release will be 2.0.0.Final - "North Atlantic".๐ New and Noteworthy
- ๐ Documentation fixes. This is the release candidate 2 of cache2k version 2.0
API Changes Possible Breakages
- ๐ฆ Move
Weigher
to packageorg.cache2k.operation
.
๐ Fixes and Improvements
- ๐ Fix site build for Java 11
- ๐ Documentation touch ups
- ๐ Change configuration XML schema to version 2 and archive version 1
- Event listeners will be send the wrapped cache
-
v1.9.4.Beta Changes
December 07, 2020๐ This is a preview release for evaluation purposes and should not be used in production.
The preview is in preparation for version 2 which will have some major breaking
changes to the previous releases. The final release will be 2.0.0.Final - "North Atlantic".๐ New and Noteworthy
- ๐ Last set of API changes. This is the release candidate 1 of cache2k version 2.0
Possible Breakages
- N/A
API Changes Possible Breakages
- Customizations can implement
AutoCloseable
, changed fromCloseable
, Java 8 improvement Cache
andCacheManager
implementsAutoCloseable
, changed fromCloseable
, Java 8 improvement- โฑ
Scheduler
andTimeReference
available in base configuration and API
๐ Fixes and Improvements
- Common timer threads are destroyed when last cache is closed, []GH#167](#167),
Thanks Jingxiao Gu / @dawnwords for reporting! - 0๏ธโฃ Corner case: Don't drop a altered default name after all cache managers are closed
-
v1.9.3.Alpha Changes
November 28, 2020๐ This is a preview release for evaluation purposes and should not be used in production.
The preview is in preparation for version 2 which will have some major breaking changes to the previous releases. The final release will be 2.0.0.Final - "North Atlantic".
๐ New and Noteworthy
- โก๏ธ Update to enhance compatibility of client code between version 1.6 with 2.0 of cache2k
API Changes / Possible Breakages
- ๐ Within alpha: Un deprecate
KeyValueSource
, that's simple and useful - โฌ๏ธ Drop
ExpiryTimeValues.NO_CACHE
.ExpiryTimeValues.NOW
which has a value of 0 means no caching, and does not start a refresh. IntroducedExpiryTimeValues.REFRESH
again, sinc logically everything between 0 (exclusive) and the current time, expires and starts a refresh, if refresh ahead is enabled. - Within alpha: Reverse hierarchy for new CacheLoaderException, which enhanced compatibility with code doing an instanceof
๐ Fixes and Improvements
- Cap suppression or caching of exceptions determined by
ResiliencePolicy
to theexpireAfterWrite
duration, if specified
-
v1.9.2.Alpha Changes
November 23, 2020๐ This is a preview release for evaluation purposes and should not be used in production.
The preview is in preparation for version 2 which will have some major breaking
changes to the previous releases. The final release will be 2.0.0.Final - "North Atlantic".๐ New and Noteworthy
- @nullable annotations
- ๐ General scheme to enable extra functionality, used for JMX and Micrometer support
- 0๏ธโฃ No caching of exceptions by default. This has to be enabled explicitly by specifying
0๏ธโฃResiliencePolicy
. Previous default resilience available asUniversalResiliencePolicy
in
cache2k-addon
Possible Breakages
๐ Since this is a major release, some rarely used things in the API are
๐ changed without backwards compatibility. Most code is supposed to run
without breaking.- ๐
Cache.getStatistics
removed. Replaced byCacheManagement.of(Cache).sampleStatistics()
. - ๐
Cache.clearAndClose
removed. Replaced byCacheManagement.destroy
- โ Removed deprecated
MutableCacheEntry.getCurrentTime
, replaced withgetStartTime
- โ Remove
MutableCacheEntry.wasExisting
andMutableCacheEntry.getOldValue
- ๐ Rename
MutableCacheEntry.getRefreshedTime
togetModificationTime
MutableCacheEntry.exists
: Does not change the value aftersetValue
or triggered loadMutableCacheEntry.getValue
: Does not change the value aftersetValue
- ๐ง Every class with
Configuration
shortened toConfig
and consequently changed the
๐ง package nameorg.cache2k.configuration
toorg.cache2k.config
. Cache2kBuilder.toConfiguration()
renamed toconfig()
- ๐ง Lots restructuring around the extra configuration sections and customizations
- โ remove
Cache2kBuilder.enableJmx
. Replaced withCache2kBuilder.enable(JmxSupport.class)
- ๐
Cache.requestInterface
throwsUnsupportedOperationException
if the requested interface
๐ is not supported instead of null - ๐ Change in special expiry values semantics: Remove
ExpiryTimeValues.REFRESH
.
ExpiryTimeValues.NOW
expires and starts a refresh if refresh ahead is enabled.
ExpiryTimeValues.NO_CACHE
expires and starts no refresh. - 0๏ธโฃ No caching of exceptions by default. This has to be enabled explicitly by specifying
0๏ธโฃResiliencePolicy
. Previous default resilience available asUniversalResiliencePolicy
in
cache2k-addon
API Changes
- ๐ Renamed
ExceptionInformation
toLoadExceptionInfo
- ๐ New method
CacheEntry.getExceptionInfo()
- ๐
org.cache2k.jmx
, API for JMX MXBeans removed - ๐ New interfaces
CacheManagement
,CacheControl
andCacheInfo
inorg.cache2k.management
- ๐ New method:
MutableCacheEntry.lock
- ๐ Rename
MutableCacheEntry.reload
toMutableCacheEntry.load
- โ Remove
TimeReference
interface from public API and make that local tocache2k-core
- ๐ New method:
MutableCacheEntry.getExpiryTime()
- โ Remove
Cache2kBuilder.enableJmx
Cache2kBuilder
: New methods `set- ๐ New methods:
Cache.mutate
,Cache.mutateAll
๐ Fixes and Improvements
- ๐ป
Cache.loadAll()
andCache.reloadAll()
complete with exception if a a loader
๐ป exception happened. If more than one exception happened the one is propagated. - ๐ Improved interface of
ExceptionPropagator
andLoadExceptionInfo
,
๐ป ACacheEntry
may be cast toLoadExceptionInfo
if an exception is present Cache.invoke
,EntryProcessor
: Make expiry calculations and listeners calls more consistent
if expiry event races with the start of the operation- ๐
MutableCacheEntry.lock
allows to lock an entry for mutation explicitly Cache.asMap
/ConcurrentMap
implementation implements compute methods
and runs them only once- ๐ Introduced
ConfigAugmenter
which can make changed to the configuration before a cache is build - ๐ง
Cache2kBuilder
: Methodssetup
,apply
allow to execute a function on the configuration
๐ or builder, which can be used to factor out configuration fragments.
We use this to provideenable
anddisable
methods on policies. - ๐ป AdvancedCacheLoader, AsyncCacheLoader and ExpiryPolicy get null if current entry carries exception, #163
- โ Remove ServiceLoader from JMX support in
cache2k-jmx
,cache2k-micrometer
- Introduce concept of
CacheFeature
andToggleCacheFeature
- ๐
CacheType
: immutable instead of bean.CacheType.of
moved fromCacheTypeCapture
- โ Remove the need of serializable from the configuration objects, by doing a deep
๐ง copy of the default configuration via bean setters and getters. Cache2kConfig
: MakesetEternal
a separate flag.
โ Remove logic from setters, so we can use setters and getter to copy the
objectCache.mutate
,Cache.mutateAll
for a mutation only entry processor variant@Nullable
,@NonNull
annotations- Within alpha: change new ExceptionPropagator from
<K>
to<K, V>
, dito atLoadExceptionInfo
- @nullness annotations
- Lots of typing refinements
Cache.entries
andCache.keys
return aSet
Cache.computeIfAbsent
with function- Ignore
entryCapacity
setting in case a weigher is specified - ๐ Allow listeners to throw a checked exception
-
v1.9.1.Alpha Changes
October 13, 2020๐ This is a preview release for evaluation purposes and should not be used in production.
The preview is in preparation for version 2 which will have some major breaking changes to the previous releases. The final release will be 2.0.0.Final - "North Atlantic".
๐ New and Noteworthy
- cache2k-api, cache2k-core, cache2k-jmx and cache2k-config are fully modularized
- Requires at least Java 8 to run
- ๐ง Adaptions to Java 8 on API level. E.g. use of Duration in the configuration
- ๐ New interfaces for
CacheLoader
andCacheWriter
- ๐ Removal of deprecated classes and methods
- ๐ง JMX and XML configuration support is no longer part of
cache2k-core
- ๐ OSGi support with
cache2k-osgi-all
removed, see: #83
Possible Breakages
๐ Since this is a major release, some rarely used things in the API are changed without backwards compatibility. Most code is supposed to run without breaking.
- Requires at least Java 8 to run
- โ Remove deprecated classes and methods:
Cache.prefetch
,Cache.prefetchAll
,IntCache
,LongCache
,
CacheEntry.getLastModification
,AbstractCacheEntry
- Incompatible change of
CustomizationSupplier
interface - ๐
org.cache2k.integration.ResiliencePolicy
removed. Replaced by:org.cache2k.io.ResiliencePolicy
- ๐ JMX support moved from
cache2k-core
tocache2k-jmx
to minimize module dependencies - ๐ง XML configuration moved from
cache2k-core
tocache2k-config
to minimize module dependencies - โฌ๏ธ Dropped apache commons logging support. Commons logging seems to be not
๐ maintained any more and lacks Jigsaw/module support. - โฌ๏ธ Drop support for XML configuration on Android, removed XML pull dependency
๐ (The Android will be potentially unsupported in cache2k V2 at first) - ๐ง Moved JCache configuration classes in
org.cache.jcache
fromcache2k-api
tocache2k-jcache
.
If these are used,cache2k-jcache
needs to be in compile scope. Cache2kConfiguration
: Changed all parameters of type long, representing
milliseconds to typeDuration
API Changes
- ๐ฆ
org.cache2k.integration.CacheLoader
and everything in packageorg.cache2k.integration
๐ is deprecated. Replacements are available inorg.cache2k.io
. This major change was done to
๐ change from abstract classes to interface. The new package was introduced for smoother transition
๐ to keep the previous classes and deprecated them. - โ Add
Cache.loadAll
andCache.reloadAll
which returnCompletableFuture
๐ Old methods which useCacheOperationCompletionListener
are deprecated - โ Remove deprecated classes and methods:
Cache.prefetch
,Cache.prefetchAll
,IntCache
,LongCache
,
CacheEntry.getLastModification
,AbstractCacheEntry
๐ Fixes and Improvements
- All cache customizations (e.g.
CacheLoader
) implementCustomization
. - ๐ Speedup of internal hash table, because compatibility for Java 6 could be removed
-
v1.6.0.Final Changes
October 08, 2020๐ cache2k is a high performance and light weight in-process caching library. Compared to other libraries
(EHCache, Guava and Caffeine) it achieves the highest throughput for cache hits while still providing
one of the best eviction efficiency. Advanced features of cache2k, like refresh ahead and resilience
can solve typical application problems with ease.๐ฒ This change log lists the complete changes since the last stable version 1.4.1.Final.
๐ New and Noteworthy
- ๐ New timer based on hierarchical timer wheels, which is more performance and
scales linear with more cache entries - No more extra thread per cache, in cache timer is used, e.g. for expiry
Potential breakages
- 0๏ธโฃ No separate executor for async listeners by default any more.
If an async listener executor is not specified it uses the executor
0๏ธโฃ defined byCache2kBuilder.executor
which in turn defaults to the
commonForkJoinPool
in Java 8. - Slightly more lag for operations triggered by time, e.g. cache
cleanup after expiry, calls of expiry listeners, refreshing.
The lag can be controlled byCache2kBuilder.timerLag
API Changes
- ๐ Deprecated
ExpiryTimeValues.NO_CACHE
- ๐ Deprecated
Cache2kBuilder.prefetchExecutor
, introducedCache2kBuilder.refreshExecutor
(rename) - ๐ Deprecated
Cache.prefetch
andCache.prefetchAll
๐ Fixes and Improvements
- โ Remove hash quality metric
MutableCacheEntry.reload()
does load the entry even if already cached- ๐ After recovering from a load exception the expiry policy did not see the
๐ป correct previous entry value with the exception - ๐ Improved internal structure and test coverage
Using this cache2k version
The binaries are available on maven central.
For Java SE/EE and Android environments
For Maven users:
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-base-pom</artifactId> <version>1.6.0.Final</version> <type>pom</type> </dependency>
Recommended for Gradle users:
def cache2kVersion = '1.6.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 GuideUsing the JCache / JSR107 provider
Maven users include the cache2k JCache provider this way:
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-jcache</artifactId> <version>1.6.0.Final</version> <scope>runtime</scope> </dependency>
For Gradle users:
dependencies { runtimeOnly "org.cache2k:cache2k-jcache:1.6.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
- ๐ New timer based on hierarchical timer wheels, which is more performance and
-
v1.5.2.Beta Changes
October 08, 2020๐ This is a preview release for evaluation purposes and should not be used in production.
The final release is planed as "Gulf of Thailand 1.6.0.Final".๐ New and Noteworthy
- N/A
Possible Breakages
- N/A
API Changes
- ๐ Deprecated
Cache.prefetch
andCache.prefetchAll
๐ Fixes and Improvements
- ๐ After recovering from a load exception the expiry policy did not see the
๐ป correct previous entry value with the exception - ๐ Improved internal structure and test coverage
-
v1.5.1.Alpha Changes
October 04, 2020๐ This is a preview release for evaluation purposes and should not be used in production.
The final release is planed as "Gulf of Thailand 1.6.0.Final".๐ New and Noteworthy
- ๐ New timer based on hierarchical timer wheels, which is more performance and
scales linear with more cache entries - No more extra thread per cache, in cache timer is used, e.g. for expiry
Possible Breakages
- 0๏ธโฃ No separate executor for async listeners by default any more.
If an async listener executor is not specified it uses the executor
0๏ธโฃ defined byCache2kBuilder.executor
which in turn defaults to the
commonForkJoinPool
in Java 8. - Slightly more lag for operations triggered by time, e.g. cache
cleanup after expiry, calls of expiry listeners, refreshing.
The lag can be controlled byCache2kBuilder.timerLag
API Changes
- ๐ Deprecated
ExpiryTimeValues.NO_CACHE
- ๐ Deprecated
Cache2kBuilder.prefetchExecutor
, introducedCache2kBuilder.refreshExecutor
(rename)
๐ Fixes and Improvements
- โ Remove hash quality metric
MutableCacheEntry.reload()
does load the entry even if already cached
- ๐ New timer based on hierarchical timer wheels, which is more performance and
-
v1.4.1.Final Changes
October 02, 2020๐ cache2k is a high performance and light weight in-process caching library. Compared to other libraries
(EHCache, Guava and Caffeine) it achieves the highest throughput for cache hits while still providing
one of the best eviction efficiency. Advanced features of cache2k, like refresh ahead and resilience
can solve typical application problems with ease.๐ Critical bug fix for
1.4.0.Final
.๐ Fixes
- Race under special conditions in
Cache.computeIfAbsent
,Cache.peekAndPut
,Cache.get
with loader.
๐ See: #155
Using this cache2k version
The binaries are available on maven central.
For Java SE/EE and Android environments
For Maven users:
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-base-pom</artifactId> <version>1.4.1.Final</version> <type>pom</type> </dependency>
Recommended for Gradle users:
def cache2kVersion = '1.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 GuideUsing the JCache / JSR107 provider
Maven users include the cache2k JCache provider this way:
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-jcache</artifactId> <version>1.4.1.Final</version> <scope>runtime</scope> </dependency>
For Gradle users:
dependencies { runtimeOnly "org.cache2k:cache2k-jcache:1.4.1.Final" }
๐ง Implementation details, tuning tips and hints on configuration can be found at: JCache - cache2k User Guide
- Race under special conditions in
-
v1.4.0.Final Changes
September 12, 2020๐ cache2k is a high performance and light weight in-process caching library. Compared to other libraries
(EHCache, Guava and Caffeine) it achieves the highest throughput for cache hits while still providing
one of the best eviction efficiency. Advanced features of cache2k, like refresh ahead and resilience
can solve typical application problems with ease.Highlights of the new version:
๐ฒ This change log lists the complete changes since the last stable version 1.2.4.Final.
๐ New and Noteworthy
Weigher
AsyncCacheLoader
- Eviction listener and eviction improvements
- ๐ Synchronous execution of expiry listener
- ๐ Micrometer support
- Online resize of caches
- ๐ Support for GraalVM native image build
API Changes
๐ New methods / fields:
- 0๏ธโฃ
CacheManager.STANDARD_DEFAULT_MANAGER_NAME
CacheInfoMXBean.isWeigherPresent()
CacheInfoMXBean.isLoaderPresent()
CacheInfoMXBean.getTotalWeight()
CacheInfoMXBean.getMaximumWeight()
CacheInfoMXBean.getCapacityLimit()
Cache.getStatistics()
๐ New interface:
AsyncCacheLoader
๐ Deprecation:
IntCache
,LongCache
- ๐
Cache2kBuilder.buildIntCache()
,Cache2kBuilder.buildLongCache()
API Changes and Potential breakages
๐
Cache2kBuilder.addListener
will execute anEntryExpiredLister
synchronously. In version
1.2 an expiry listener was always executed asynchronously. This is an potentially incompatible
๐ change, in case expiry listeners are used. Review the existing client code and
๐ make sure that addAsyncListeners is used for anEntryExpiredLister
if that is wanted.๐ Fixes
- ๐ Fix
CacheManager.setDefaultName
, see GH#108 - ๐ race of refresh and delete: if an entry is deleted via
Cache.remove
it was not
reappearing when refreshed concurrently - ๐ fix missing expiry listener call after a created listener call, in case expiry during the insert
expiry
,expireAfterWrite
,refreshAhead
: Fix race condition of aCache.put
and the
๐ Improvements
- โ Remove randomized hash seed and simplify the "rehashing" of hash codes identical to Java
HashMap
andConcurrentHashMap
- Async Cacheloader GH#93
CacheEntryEvictionListener
added, GH#59- ๐ฆ Expose cache statistics via
Cache.getStatistics()
- ๐ Eviction: Efficiency improvements, see comment: #101 (comment)
- ๐ Expiry listener supports synchronous operation
- ๐ Deprecated IntCache and LongCache
- Internal: Improvement and simplification of
ExceptionPropagator
handling
termination of the probation period after a refresh. Cache.invoke
/EntryProcessor
: Internal improvements when using listeners: avoid unnecessary
entry reads- internal cleanup: use common code for refresh in different cache variants
- eviction efficiency fix for a few special short traces
- ๐ Support for new cache methods from Spring Framework 5.2
- doc clarifications and improvements
- 0๏ธโฃ SpringCache2kCacheManager.setAllowUnknownCache is true by default, to minimize initial setup
- ๐จ
CacheEntry.toString
output does not calltoString
on the value and print hashCode instead - doc clarifications
- ๐ Code style improvements
Using this cache2k version
The binaries are available on maven central.
For Java SE/EE and Android environments
For Maven users:
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-base-pom</artifactId> <version>1.4.0.Final</version> <type>pom</type> </dependency>
Recommended for Gradle users:
def cache2kVersion = '1.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 GuideUsing the JCache / JSR107 provider
Maven users include the cache2k JCache provider this way:
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-jcache</artifactId> <version>1.4.0.Final</version> <scope>runtime</scope> </dependency>
For Gradle users:
dependencies { runtimeOnly "org.cache2k:cache2k-jcache:1.4.0.Final" }
๐ง Implementation details, tuning tips and hints on configuration can be found at: JCache - cache2k User Guide