VladRodionov opened a new pull request, #8575:
URL: https://github.com/apache/hbase/pull/8575

   ## Summary
   
   This PR extends the topology-backed cache access framework so that cache 
diagnostics and cache
   access are consistently routed through `TopologyBackedCacheAccessService`.
   
   The main change is that plain single-tier `BlockCache` implementations now 
use the same
   topology-backed access path as combined caches. Single-tier caches are 
represented by
   `SingleTierTopology`, while existing two-tier cache variants continue to use 
topology-specific
   representations:
   
   * `BlockCache` -> `SingleTierTopology`
   * `CombinedBlockCache` -> `TieredExclusiveTopology`
   * `InclusiveCombinedBlockCache` -> `TieredInclusiveTopology`
   
   This keeps the legacy cache implementations underneath through 
`BlockCacheBackedCacheEngine`, but
   moves the access-service boundary to the topology/cache-engine model.
   
   ## Motivation
   
   After HBASE-30305, exclusive combined-cache orchestration was moved behind
   `TopologyBackedCacheAccessService`. Follow-up testing showed that diagnostic 
and compatibility paths
   still had assumptions about `BlockCacheBackedCacheAccessService` and 
concrete `BlockCache`
   implementations.
   
   This PR removes those assumptions from the main factory path by making 
topology-backed access the
   normal path for both single-tier and combined caches.
   
   ## Changes
   
   * Added `SingleTierTopology`.
   * Added `CacheTopologyType.SINGLE_TIER`.
   * Added topology-backed factory support for single-tier `BlockCache` 
instances.
   * Added explicit topology-backed support for `InclusiveCombinedBlockCache`.
   * Preserved separate semantics for exclusive and inclusive combined caches:
     * exclusive promotion moves a block between tiers;
     * inclusive promotion copies a block and keeps the source tier;
     * inclusive eviction evicts from all tiers.
   * Added cached-block iterable diagnostics through the topology-backed 
service.
   * Preserved legacy default `cacheBlock(key, block)` behavior for single-tier 
caches.
   * Added test helpers for unwrapping legacy `BlockCache` instances from 
topology-backed services
     where tests still need direct compatibility checks.
   * Added focused tests for:
     * single-tier topology-backed cache access;
     * exclusive combined-cache compatibility;
     * inclusive combined-cache compatibility.
   
   ## Compatibility notes
   
   `BlockCacheBackedCacheAccessService` is no longer the default factory result 
for plain block caches.
   Instead, the main factory now returns a `TopologyBackedCacheAccessService` 
backed by
   `SingleTierTopology`.
   
   The underlying legacy `BlockCache` implementations are still preserved 
through
   `BlockCacheBackedCacheEngine`. This PR does not migrate `LruBlockCache`, 
`BucketCache`, or other
   concrete cache implementations to native `CacheEngine` implementations yet. 
That remains a follow-up
   migration step.
   
   ## Testing
   
   Focused tests:
   
   ```bash
   mvn -pl hbase-server \
     -Dtest=TestSingleTierTopologyBackedCacheAccessService test
   
   mvn -pl hbase-server \
     -Dtest=TestCombinedBlockCacheCompatibleTopologyBackedCacheAccessService 
test
   
   mvn -pl hbase-server \
     
-Dtest=TestInclusiveCombinedBlockCacheCompatibleTopologyBackedCacheAccessService
 test
   
   mvn -pl hbase-server \
     -Dtest=TestHFile test
   
   mvn -pl hbase-server \
     -Dtest=TestBlockCacheReporting test


-- 
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]

Reply via email to