VladRodionov opened a new pull request, #8844:
URL: https://github.com/apache/hbase/pull/8844
## HBASE-30471 Remove LruBlockCache dependencies from test and production
code
### Summary
This PR continues the pluggable block cache migration by removing direct
dependencies on
`LruBlockCache` from production and test code where the new `CacheEngine` /
`CacheAccessService` APIs can be used instead.
The main goal is to move LRU-specific behavior and tests to `LruCacheEngine`
while keeping legacy
`BlockCache` implementations supported through the existing compatibility
adapters.
This PR is based on `HBASE-30018` and assumes the `HBASE-30383` RegionServer
`CacheAccessService` migration is already present in that branch.
### Changes
- Migrates the former `TestLruBlockCache` coverage to `TestLruCacheEngine`.
- Removes `TestLruBlockCache`.
- Extends `LruCacheEngine` with the functionality needed by the migrated
unit tests.
- Updates HFile/cache production code to use `CacheEngine` /
`CacheAccessService` abstractions
instead of depending directly on `LruBlockCache`.
- Updates affected HFile and cache tests to work through the new cache
abstractions.
- Adds `BlockCacheTestUtils` for test cases that still need to exercise
legacy `BlockCache`
implementations during the transition.
- Extends `CacheTestUtils`, `CacheAccessServiceTestFactory`, and
`CacheAccessServiceTestInstance` to support both legacy `BlockCache` and
new `CacheEngine`
based tests.
- Updates `TopologyBackedCacheAccessService` and related helpers where
needed to expose the
functionality required by migrated callers and tests.
- Keeps compatibility with legacy cache implementations through the existing
adapter layer rather
than introducing new direct `LruBlockCache` dependencies.
### Scope
This PR does **not** attempt to remove every remaining `BlockCache`
reference from HBase.
`BlockCache` is still required for legacy cache implementations and
compatibility adapters that have
not yet been migrated. Those references will be removed incrementally as the
remaining cache
implementations are converted.
The purpose of this change is specifically to eliminate unnecessary
`LruBlockCache` dependencies
from code that can now use the pluggable cache APIs.
### Behavior
No user-visible cache behavior change is intended.
The changes are primarily an internal API and test migration from the
concrete
`LruBlockCache` implementation to `LruCacheEngine`, `CacheEngine`, and
`CacheAccessService`.
### Validation
The affected cache and HFile unit tests are exercised as part of this
change, including the migrated
`TestLruCacheEngine` coverage and tests for cache access, cache-on-write,
HFile block handling,
scanner behavior, and block encoding.
`git diff --check` is clean.
### AI-assisted development
This change was developed in collaboration with **ChatGPT 5.6 Sol**. ChatGPT
was used as a
development and review assistant for code migration, test adaptation, API
design discussion, and
review feedback. All resulting code and design decisions were reviewed and
validated by the author.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]