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 the CacheProviderAPIImpl 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 of Optional and Try 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 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