VladRodionov opened a new pull request, #8876:
URL: https://github.com/apache/hbase/pull/8876
## Summary
Migrate `IndexOnlyLRU` to the pluggable cache architecture.
The legacy `IndexOnlyLruBlockCache` specializes `LruBlockCache` only by
filtering cache
admission: data blocks are rejected while non-data blocks are admitted.
Rather than introducing
another specialized `CacheEngine`, this change represents that behavior
using the existing cache
architecture:
- `LruCacheEngine` for cache storage and LRU eviction
- `SingleTierTopology` for the standalone cache topology
- `IndexOnlyCachePlacementAdmissionPolicy` for block admission
This keeps admission policy separate from cache-engine implementation.
## Changes
- Add `IndexOnlyCachePlacementAdmissionPolicy`.
- Preserve the existing `IndexOnlyLruBlockCache` admission semantics:
- reject blocks in the `DATA` category
- admit non-data blocks
- Select the new admission policy when
`hbase.blockcache.policy=IndexOnlyLRU`.
- Use the native `LruCacheEngine` for the `IndexOnlyLRU` configuration.
- Update `TestCacheConfig` to verify the new engine/policy architecture and
preserved admission
behavior.
- Update `TestClientSideRegionScanner` to verify that its cache uses:
- `LruCacheEngine`
- `CacheTier.SINGLE`
- `IndexOnlyCachePlacementAdmissionPolicy`
- Add focused unit coverage for `IndexOnlyCachePlacementAdmissionPolicy`.
## Architecture
Before:
IndexOnlyLRU
-> IndexOnlyLruBlockCache
-> BlockCacheBackedCacheEngine
After:
IndexOnlyLRU
-> TopologyBackedCacheAccessService
-> SingleTierTopology
-> LruCacheEngine
-> IndexOnlyCachePlacementAdmissionPolicy
The legacy `IndexOnlyLruBlockCache` remains available for the transitional
`BlockCache` path and
can be removed together with the remaining `BlockCache` implementation
during the final migration.
## Behavior
No user-visible behavior change is intended.
Despite its historical name, `IndexOnlyLruBlockCache` admits all non-data
blocks rather than only
literal index blocks. The new admission policy intentionally preserves that
behavior.
## AI-assisted development
This change was developed in collaboration with **ChatGPT 5.6 Sol**. ChatGPT
was used as a
development and review assistant for architecture discussion, code
migration, and test adaptation.
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]