Releases: ben-manes/caffeine
Releases · ben-manes/caffeine
3.0.5
Cache
- Fixed reference eviction when used with a broken executor (JDK-8274349)
- Suppressed log warnings if a future is cancelled or times out (#597)
- Removed
@Nullable
fromLoadingCache.get(key)
(#594) - Fixed early expiration of in-flight async loads (#625)
JCache
close()
will now shutdown the executor and wait for in-flight loads to finish
2.9.3
Cache
- Fixed reference eviction when used with a broken executor (JDK-8274349)
- Reduced the entry overhead by 8 bytes when using weak or soft values
- Suppressed log warnings if a future is cancelled or times out (#597)
- Fixed Map.entrySet.contains(o) to use reference equality
- Fixed early expiration of in-flight async loads (#625)
JCache
close()
will now shutdown the executor and wait for in-flight loads to finish
3.0.4
Cache
- Fixed cases that incorrectly notified the removal listener for no-op replacements (#593)
- Improved how refreshAfterWrite is triggered on a read to avoid hotspots
- Added the ability to capture coldest & hottest weighted snapshots
- Reduced the per-entry overhead when using weak/soft values
- Fixed
Map.entrySet.contains(o)
to use reference equality
3.0.3
Cache
- Fixed reading an intermittent null weak/soft value during a concurrent write (#568)
- Fixed extraneous eviction when concurrently removing a collected entry after a writer resurrects it with a new mapping (#568)
- Fixed excessive retries of discarding an expired entry when the fixed duration period is extended, thereby resurrecting it (#568)
2.9.2
Cache
- Fixed reading an intermittent null weak/soft value during a concurrent write (#568)
- Fixed extraneous eviction when concurrently removing a collected entry after a writer resurrects it with a new mapping (#568)
- Fixed excessive retries of discarding an expired entry when the fixed duration period is extended, thereby resurrecting it (#568)
3.0.2
2.9.1
3.0.1
3.0.0
This release includes API incompatible changes.
Highlights
- Java 11 or above is required
- Java 8 users can continue to use version 2.x, which will be supported
API improvements
- Added
Policy.refreshes()
for a snapshot of the in-flight refresh operations CacheLoader
andAsyncCacheLoader
offerbulk
factory methodsAsyncCacheLoader
methods may now throw checked exceptions- Better usage of Checker Framework nullness annotations (#337)
LoadingCache.refresh
now returns the in-flight future (#143)- Various unimplemented default methods are now abstract
- Added
LoadingCache.refreshAll
convenience method - Bulk loads now receive a
Set
of keys (wasIterable
) - More flexible generic bounds and type parameters
Implementation improvements
- Refresh operations ignore redundant calls during an in-flight load and are linearizable (#193, #236, #282, #322, #373, #467)
- The Java Platform Logging API is used instead of
java.util.logging
(#456) sun.misc.Unsafe
is no longer required (#273)
Incompatible changes
VarExpiration
time-based puts now return the old value instead of a boolean result- Removed jandex resource as no longer utilized by Quarkus
- Split
Policy.Expiration
into fixed and refresh interfaces
Deprecation removals
CacheWriter
,SingleConsumerQueue
, andUnsafeAccess
StatsCounter.recordEviction
variationsCacheStats
constructors
Notes
CacheWriter
usages can be replaced byMap
computations andCaffeine.evictionListener
- For best performance
Unsafe
may be used if available, otherwise falls back toVarHandles
- We will continue to support and maintain version 2.x for Java 8 users
2.9.0
Cache
- Added
Caffeine.evictionListener
which is notified within the atomic operation when an entry is automatically removed - Added triggering cache maintenance if an iterator observes an expired entry for more aggressive eviction (#487)
- Improved eager eviction of an added or updated entry if it exceeds the cache's maximum weight
- Deprecated
CacheWriter
. Please useasMap
computations or an eviction listener instead - Added
CacheStats.of(...)
to allow for becoming a value-based class in a future release