HBASE-30206 Add test factory helpers for CacheAccessService-backed ca…#8359
Open
VladRodionov wants to merge 1 commit into
Open
Conversation
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
This PR adds test-only factory helpers for creating CacheAccessService instances backed by existing legacy BlockCache implementations.
The goal is to make test migration to CacheAccessService less verbose. Many existing tests directly instantiate concrete BlockCache implementations such as LruBlockCache, LruAdaptiveBlockCache, TinyLfuBlockCache, and BucketCache. For integration-style tests that only need a cache facade, replacing a one-line constructor with several lines of BlockCache construction plus CacheAccessService wrapping adds noise.
This PR provides constructor-shaped test helpers that keep those tests concise while preserving the current legacy-backed implementation path.
Changes
Compatibility notes
The factory helpers are test-only bridge utilities. They currently create legacy BlockCache implementations and wrap them with BlockCacheBackedCacheAccessService.
This does not change production cache construction. It also does not migrate existing cache implementations to CacheEngine. Later, when CacheEngine and topology-backed services are available, these factory internals can be updated without rewriting all integration-style tests again.
Out of scope
Testing
Ran:
mvn -pl hbase-server -Dtest=TestCacheAccessServiceTestFactory test mvn -pl hbase-server -DskipTests compile mvn -pl hbase-server spotless:check mvn -pl hbase-server checkstyle:checkDisclosure
Parts of this PR, including helper code structure and PR description text, were prepared with assistance from ChatGPT 5.5 and reviewed by the author.