Skip to content

HBASE-30104 Refactor LruBlockCache to implement CacheEngine - #8653

Open
VladRodionov wants to merge 1 commit into
apache:HBASE-30018from
VladRodionov:HBASE-30104-refactor-lrublockcache-cacheengine
Open

VladRodionov wants to merge 1 commit into
apache:HBASE-30018from
VladRodionov:HBASE-30104-refactor-lrublockcache-cacheengine

Conversation

@VladRodionov

Copy link
Copy Markdown
Contributor

This PR introduces LruCacheEngine as the native CacheEngine implementation of the existing
LruBlockCache functionality.

The goal is to migrate the LRU block cache implementation to the new pluggable block cache
architecture without requiring LruBlockCache to be wrapped by BlockCacheBackedCacheEngine.

Main changes:

  • Add LruCacheEngine as a native CacheEngine implementation.
  • Preserve the existing LRU cache implementation, eviction algorithm, accounting, statistics,
    configuration, and test-facing functionality.
  • Remove victim-cache orchestration from the LRU implementation. Tier interaction is now the
    responsibility of CacheTopology.
  • Add CacheEvictionListener support for capacity-driven eviction events.
  • Propagate L1 capacity evictions through CacheTopology so TieredExclusiveTopology can move
    evicted blocks to L2.
  • Preserve inclusive topology semantics where an L1 capacity eviction does not unnecessarily
    reinsert a block already present in L2.
  • Add native CacheEngine construction to BlockCacheFactory.
  • Update CacheAccessServices configuration-based construction to use native CacheEngine
    implementations directly where available.
  • Keep BlockCacheBackedCacheEngine as the compatibility adapter for cache implementations that
    have not yet been migrated.
  • Update CacheConfig copy semantics so a native CacheAccessService is preserved even when no
    legacy BlockCache is available.
  • Update BlockCacheUtil functionality required by native CacheEngine implementations.
  • Add explicit test coverage verifying that the LRU policy creates LruCacheEngine directly.
  • Update affected HFile tests to validate the native CacheEngine rather than requiring an
    underlying LruBlockCache.

The production RegionServer still owns a legacy BlockCache. Migrating RegionServer ownership to
CacheAccessService is intentionally left for a follow-up issue. Dynamic cache sizing used by
HeapMemoryManager is also being handled separately.

Tests:

  • hbase-server compilation passes.
  • Relevant block cache, topology, CacheConfig, and HFile tests pass.
  • Spotless/checkstyle checks pass.

@VladRodionov
VladRodionov force-pushed the HBASE-30104-refactor-lrublockcache-cacheengine branch from 3b1e9a7 to d6ff7a9 Compare September 16, 2026 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant