VladRodionov opened a new pull request, #8325: URL: https://github.com/apache/hbase/pull/8325
### Summary This PR continues the pluggable block cache refactoring by migrating cache population paths to use CacheAccessService instead of calling BlockCache directly where the code is part of HFile cache access behavior. The change keeps the runtime behavior legacy-compatible. Existing BlockCache implementations are still used through BlockCacheBackedCacheAccessService. This PR does not refactor BlockCacheFactory, does not introduce CacheEngine-backed runtime wiring, and does not attempt to migrate all remaining BlockCache references. The main goal is to make CacheAccessService the HBase-facing facade for cache lookup, insertion, invalidation, admission checks, and related cache operations while preserving existing behavior. ### Changes * Migrates additional cache population code paths from direct BlockCache usage to CacheAccessService. * Preserves simple cacheBlock(...) overloads on CacheAccessService so legacy-style call sites do not need to construct CacheWriteContext manually. * Keeps CacheWriteContext available for future richer policy-aware cache insertion paths. * Adds/uses compatibility forwarding for cache admission hooks such as shouldCacheBlock(...) and shouldCacheFile(...) where existing paths depend on them. * Adds/uses CacheAccessService.ifEnabled(...) for call sites that need the old Optional#ifPresent(...) style behavior when cache is disabled. * Preserves disabled-cache behavior through NoOpCacheAccessService. * Updates affected tests. ### Compatibility notes This PR intentionally does not force every cache insertion call site to specify a precise CacheWriteSource. Existing HBase cache population code does not always expose whether a block insertion comes from flush, compaction, bulk load, or another writer path. Guessing that source could introduce incorrect policy behavior later. Therefore, this PR keeps compatibility-oriented overloads and uses richer context only where the information is already available and meaningful. ### Out of scope * No BlockCacheFactory refactoring. * No CacheEngine adapter migration. * No migration of LruBlockCache, LruAdaptiveBlockCache, TinyLfuBlockCache, or BucketCache to CacheEngine. * No removal of BlockCache from CacheConfig. * No removal of getBlockCache(). * No migration of BlockCache.iterator(). * No diagnostic JSP/admin page migration. * No broad migration of implementation-specific cache tests. * No topology-backed runtime wiring. ### Testing Ran the affected HFile cache-on-write test successfully: bash mvn -pl hbase-server -Dtest=TestHFile#testWriterCacheOnWriteSkipDoesNotLeak test Also verified build/package after resolving a stale local class output issue unrelated to this PR. -- 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]
