Skip to content

HBASE-30363 Migrate AdaptiveLRU to LruCacheEngine and adaptive policy - #8766

Open
VladRodionov wants to merge 1 commit into
apache:HBASE-30018from
VladRodionov:HBASE-30363-adaptive-lru-policy
Open

VladRodionov wants to merge 1 commit into
apache:HBASE-30018from
VladRodionov:HBASE-30363-adaptive-lru-policy

Conversation

@VladRodionov

Copy link
Copy Markdown
Contributor

Summary

Migrates the native CacheAccessService path for AdaptiveLRU from
LruAdaptiveBlockCache to LruCacheEngine plus a dedicated adaptive
placement/admission policy.

The legacy BlockCache construction path remains unchanged.

Changes

  • Add AdaptiveLruCachePlacementAdmissionPolicy.
  • Move AdaptiveLRU admission state and adjustment logic into the policy.
  • Add eviction-pressure feedback to CacheEvictionListener.
  • Add a default eviction-pressure callback to CachePlacementAdmissionPolicy.
  • Have LruCacheEngine report requested eviction pressure (bytesToFree).
  • Have TopologyBackedCacheAccessService route:
    • concrete block evictions to CacheTopology;
    • eviction-pressure feedback to CachePlacementAdmissionPolicy.
  • Use native LruCacheEngine for AdaptiveLRU in the CacheAccessService path.
  • Preserve LruAdaptiveBlockCache for the legacy BlockCacheFactory
    construction path.

AdaptiveLRU behavior

The adaptive algorithm preserves the behavior of the legacy
LruAdaptiveBlockCache, including:

  • the existing AdaptiveLRU configuration properties;
  • the approximately 10-second evaluation window;
  • requested eviction pressure rather than actual bytes freed;
  • heavy-eviction count threshold;
  • adaptive data-block admission percentage;
  • deterministic block-offset filtering;
  • recovery when eviction pressure decreases.

For tiered caches, AdaptiveLRU controls L1 admission only. It does not
globally reject a block that can still be placed in L2.

Tests

Adds coverage for:

  • AdaptiveLRU admission adjustment and recovery;
  • single-tier data-block admission;
  • inclusive and exclusive tier placement;
  • eviction-pressure reporting by LruCacheEngine;
  • eviction-pressure routing through TopologyBackedCacheAccessService;
  • native AdaptiveLRU CacheAccessService construction;
  • preservation of the legacy LruAdaptiveBlockCache construction path.

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