[ 
https://issues.apache.org/jira/browse/HBASE-30024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Vladimir Rodionov updated HBASE-30024:
--------------------------------------
    Description: 
TieredExclusiveTopology and TopologyBackedCacheAccessService already exist as 
part of the pluggable block cache architecture. The next migration step is to 
make the existing topology-backed path usable with current legacy BlockCache 
implementations before LruBlockCache and BucketCache are migrated to 
CacheEngine directly.

CombinedBlockCache currently coordinates LruBlockCache and BucketCache using 
exclusive L1/L2 semantics. TieredExclusiveTopology is the intended topology 
model for that behavior, but existing cache implementations still implement 
BlockCache rather than CacheEngine.

This ticket adds a compatibility bridge that adapts existing BlockCache 
implementations to CacheEngine so they can participate in 
TieredExclusiveTopology and be exercised through 
TopologyBackedCacheAccessService.

Proposed approach:

* Add a BlockCache-backed CacheEngine adapter.
* Delegate get/cache/evict/stat/size/lifecycle operations from the adapter to 
the wrapped BlockCache.
* Use the adapter to build TieredExclusiveTopology instances backed by existing 
LruBlockCache and BucketCache objects.
* Add tests for topology-backed exclusive L1/L2 behavior, including L1 hit, L2 
hit, promotion, cache insertion, eviction, and shutdown.
* Preserve existing runtime behavior. This ticket should not replace default 
production CombinedBlockCache wiring unless behavior equivalence is explicitly 
proven and agreed on.

Out of scope:

* Do not introduce a new CacheTopology type.
* Do not migrate LruBlockCache to implement CacheEngine directly.
* Do not migrate BucketCache to implement CacheEngine directly.
* Do not remove CombinedBlockCache.
* Do not refactor BlockCacheFactory.
* Do not change default production cache behavior.
* Do not change cache placement, eviction, or promotion semantics beyond what 
is needed for compatibility testing.

Acceptance criteria:

* Existing BlockCache implementations can be adapted to CacheEngine.
* TieredExclusiveTopology can be assembled using BlockCache-backed engines.
* TopologyBackedCacheAccessService can exercise the adapted topology.
* Tests cover CombinedBlockCache-like exclusive L1/L2 behavior.
* Existing BlockCache-backed runtime behavior remains unchanged.
** storage (*CacheEngine*)
** policy (*CachePlacementPolicy*)
* Lays groundwork for future support of alternative topologies (e.g., inclusive 
mode)

  was:
h2. Description

Refactor *CombinedBlockCache* by extracting its tier orchestration logic into 
an explicit *TieredExclusiveTopology* abstraction.

CombinedBlockCache currently combines multiple responsibilities, including:

* coordination between L1 (*LruBlockCache*) and L2 (*BucketCache*)
* routing of block lookups across tiers
* promotion of blocks from L2 to L1 on cache hit
* aggregation of cache metrics

This change separates these concerns by introducing *TieredExclusiveTopology* 
as a dedicated orchestration layer.

h3. Scope

* Introduce *TieredExclusiveTopology* implementing L1/L2 coordination
* Move logic from CombinedBlockCache into the topology layer, including:
** lookup routing across tiers
** promotion/demotion behavior
** invalidation propagation
** metrics aggregation
* Adapt CombinedBlockCache to:
** delegate to TieredExclusiveTopology, or
** act as a temporary compatibility wrapper

h3. Notes

* No behavior change intended — *TieredExclusiveTopology* should preserve 
current CombinedBlockCache semantics
* Existing cache implementations (*LruBlockCache*, *BucketCache*) remain 
unchanged
* This is a key step toward separating:
** topology (*CacheTopology*)
** storage (*CacheEngine*)
** policy (*CachePlacementPolicy*)
* Lays groundwork for future support of alternative topologies (e.g., inclusive 
mode)


> Add BlockCache-backed CacheEngine adapter for TieredExclusiveTopology
> ---------------------------------------------------------------------
>
>                 Key: HBASE-30024
>                 URL: https://issues.apache.org/jira/browse/HBASE-30024
>             Project: HBase
>          Issue Type: New Feature
>            Reporter: Vladimir Rodionov
>            Assignee: Vladimir Rodionov
>            Priority: Major
>
> TieredExclusiveTopology and TopologyBackedCacheAccessService already exist as 
> part of the pluggable block cache architecture. The next migration step is to 
> make the existing topology-backed path usable with current legacy BlockCache 
> implementations before LruBlockCache and BucketCache are migrated to 
> CacheEngine directly.
> CombinedBlockCache currently coordinates LruBlockCache and BucketCache using 
> exclusive L1/L2 semantics. TieredExclusiveTopology is the intended topology 
> model for that behavior, but existing cache implementations still implement 
> BlockCache rather than CacheEngine.
> This ticket adds a compatibility bridge that adapts existing BlockCache 
> implementations to CacheEngine so they can participate in 
> TieredExclusiveTopology and be exercised through 
> TopologyBackedCacheAccessService.
> Proposed approach:
> * Add a BlockCache-backed CacheEngine adapter.
> * Delegate get/cache/evict/stat/size/lifecycle operations from the adapter to 
> the wrapped BlockCache.
> * Use the adapter to build TieredExclusiveTopology instances backed by 
> existing LruBlockCache and BucketCache objects.
> * Add tests for topology-backed exclusive L1/L2 behavior, including L1 hit, 
> L2 hit, promotion, cache insertion, eviction, and shutdown.
> * Preserve existing runtime behavior. This ticket should not replace default 
> production CombinedBlockCache wiring unless behavior equivalence is 
> explicitly proven and agreed on.
> Out of scope:
> * Do not introduce a new CacheTopology type.
> * Do not migrate LruBlockCache to implement CacheEngine directly.
> * Do not migrate BucketCache to implement CacheEngine directly.
> * Do not remove CombinedBlockCache.
> * Do not refactor BlockCacheFactory.
> * Do not change default production cache behavior.
> * Do not change cache placement, eviction, or promotion semantics beyond what 
> is needed for compatibility testing.
> Acceptance criteria:
> * Existing BlockCache implementations can be adapted to CacheEngine.
> * TieredExclusiveTopology can be assembled using BlockCache-backed engines.
> * TopologyBackedCacheAccessService can exercise the adapted topology.
> * Tests cover CombinedBlockCache-like exclusive L1/L2 behavior.
> * Existing BlockCache-backed runtime behavior remains unchanged.
> ** storage (*CacheEngine*)
> ** policy (*CachePlacementPolicy*)
> * Lays groundwork for future support of alternative topologies (e.g., 
> inclusive mode)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to