Issue 30670 per object ttl cache #30692
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes significant changes to the
CacheProviderAPIImpl
class and introduces new classes to handle dynamic TTL caching. The most important changes include refactoring theCacheProviderAPIImpl
class to simplify its methods, adding support for per-object TTL in caching, and implementing new cache classes.Refactoring and Simplification:
CacheProviderAPIImpl.java
: Refactored the class to simplify the initialization and management of cache providers, including the removal of unused fields and methods, and the use ofOptional
andTry
for error handling. [1] [2] [3] [4] [5] [6]Dynamic TTL Caching:
CacheValue.java
: Introduced a new class to represent cache values with an optional TTL.DynamicTTLCache.java
: Implemented a new cache class that supports dynamic TTL for each cache entry using the Caffeine library.Cache Provider Updates:
CacheProvider.java
: Added a new method to support per-object TTL in cache providers, with a default implementation that logs a warning if not supported.These changes aim to improve the flexibility and maintainability of the caching system, allowing for more granular control over cache expiration and simplifying the overall code structure.
This PR fixes: #30670