OAK-11946 : migrate cache APIs to Caffeine#2807
Open
rishabhdaim wants to merge 7 commits intotrunkfrom
Open
Conversation
reschke
requested changes
Mar 19, 2026
Contributor
reschke
left a comment
There was a problem hiding this comment.
- We should do this in smaller pieces; easier to review. Let's start with oak-store-document.
- If we just replace we just swapped one present problem with a potential future one. We need to get rid of Oak APIs that depend on an implementation that we do not control. In practice this means that we need to define an Oak caching API, and implement wrappers.
Contributor
Author
|
@reschke how would you suggest to split this ? we are only removing one guava import and rest all the linked to it. |
… order, version format
|
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


Summary
Migrates all Guava cache API usages to Caffeine (
com.github.benmanes.caffeine) across the Oak codebase.Changes
CacheLIRS,CacheStats,AbstractCacheStats,EmpiricalWeigher— replace GuavaCache/CacheBuilder/Weigher/CacheStats; bumppackage-info.javaversionDocumentNodeStore,DocumentNodeStoreBuilder,NodeDocumentCache,NodeCache,PersistentCache,CachingCommitValueResolver,LocalDiffCache,MemoryDiffCache,TieredDiffCache,NodeDocument,ForwardingListener,EvictionListener— replace Guava cache imports; adaptCallable→Function,reload()→asyncReload()SegmentCache,ReaderCache,RecordCache,WriterCacheManager,PriorityCache,CacheWeights,RecordCacheStats,SegmentCacheStats— replace Guava cache imports; add.executor(Runnable::run)andcleanUp()for synchronous evictionFileCache,CompositeDataStoreCache,UploadStagingCache,CachingBlobStore,AbstractSharedCachingDataStore,DataStoreBlobStore— replace GuavaCache/CacheBuilder/CacheLoader/AbstractCache/Weigher/RemovalCauseBlobIdSet— replaceCacheBuilderwithCaffeineS3Backend— replaceCacheBuilderwithCaffeineAzureBlobStoreBackend,AzureBlobStoreBackendV8— replaceCacheBuilderwithCaffeineExtractedTextCache— replace GuavaCache/CacheBuilder/Weigherwith CaffeineElasticIndexStatistics— replaceCacheBuilder/CacheLoader/LoadingCache/Ticker;reload()→asyncReload()returningCompletableFuture;getUnchecked()→get()DocumentNodeStoreHelper— replace GuavaCacheimportPersistentCacheTest— replace GuavaCacheimportCacheStatsMetricsTest— adapt to CaffeineCacheStats.of()Test Plan
mvn test -pl oak-core-spi— CacheLIRS, CacheStats testsmvn test -pl oak-store-document— NodeCache, DocumentNodeStore, persistent cache testsmvn test -pl oak-segment-tar— SegmentCache, PriorityCache testsmvn test -pl oak-blob-plugins— FileCache, CompositeDataStoreCache testsmvn test -pl oak-search-elastic— ElasticIndexStatistics testsLinks