Skip to content

Remove deprecated LRUBlockCache - #6596

Open
Amemeda wants to merge 2 commits into
apache:mainfrom
Amemeda:4921-remove-lru
Open

Amemeda wants to merge 2 commits into
apache:mainfrom
Amemeda:4921-remove-lru

Conversation

@Amemeda

@Amemeda Amemeda commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

LruBlockCache was depreacted in #4920 and replaced with TinyLfuBlockCache, this pr removes LruBlockCache and related code:

  • LruBlockCache.java: Deleted
  • LruBlockCacheConfiguration.java: Deleted
  • LruBlockCacheManager.java: Deleted
  • TestlLruBlockCache.java: Deleted
  • BlockCacheFactoryTest: Updated to remove deprecated test testCreateLruBlockCacheFactory()
  • CachedBlock.java: Deleted (only uses were in deleted test file)
  • CacheBlockQueue.java: Deleted (only uses were in deleted test file)
  • HeapSize.java: Deleted (only uses were in deleted test file)
  • TestCachedBlockQueue: Deleted, only tested lru cache using the above 3 files
  • SynchronizedLoadingBlockCache.java: Moved from lru subfolder to tinylfu subfolder. Still used elsewhere in code.
  • blockfile.cache.lru subfolder: Deleted

Closes #4921

@Amemeda
Amemeda marked this pull request as ready for review October 16, 2026 19:10
@Amemeda

Amemeda commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator Author

There are 4 files remaining in the cache.lru subfolder where all the lru files were deleted from. The only usage of these files is in TestCachedBlockQueue.java which is testing using lru.CachedBlock.java. All tests in this file still pass with the LRU deleted. So I am wondering, should TestCachedBlockQueue.java be deleted along with the remaining 4 files in lru package? Or I can refactor the remaining 4 files from the lru package, probably to rename the package to util or something similar.

image

@Amemeda Amemeda changed the title Remove deprecated LRUCacheBlock Remove deprecated LRUBlockCache Oct 16, 2026
@dlmarion

Copy link
Copy Markdown
Contributor

I think you can remove TestCachedBlockQueue as well

@Amemeda

Amemeda commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator Author

There is a method in BlockCacheManager.java that still has documentation referencing LRU. Unsure if this needs to be updated to TinyLFU or its talking about a different LRU like the LRU Map I see throughout the code

   /**
     * This method provides a way for a cache implementation to access arbitrary configuration set
     * by a user.
     *
     * <p>
     * When running in a tserver, returns all Accumulo properties that have a prefix of
     * {@code tserver.cache.config.<prefix>.<type>.} or
     * {@code tserver.cache.config.<prefix>.default.} with values for specific cache types
     * overriding defaults.
     *
     * <p>
     * When running in a scan server, returns all Accumulo properties that have a prefix of
     * {@code sserver.cache.config.<prefix>.<type>.} or
     * {@code sserver.cache.config.<prefix>.default.} with values for specific cache types
     * overriding defaults.
     *
     * <p>
     * For example assume the following data is in Accumulo's system config and the plugin is
     * running in a tserver.
     *
     * <pre>
     * tserver.cache.config.lru.default.evictAfter=3600
     * tserver.cache.config.lru.default.loadFactor=.75
     * tserver.cache.config.lru.index.loadFactor=.55
     * tserver.cache.config.lru.data.loadFactor=.65
     * </pre>
     *
     * <p>
     * If this method is called with {@code prefix=lru} and {@code type=INDEX} then it would return
     * a map with the following key values. The load factor setting for index overrides the default
     * value.
     *
     * <pre>
     * evictAfter=3600
     * loadFactor=.55
     * </pre>
     *
     * @param prefix A unique identifier that corresponds to a particular BlockCacheManager
     *        implementation.
     */
    Map<String,String> getProperties(String prefix, CacheType type);

This branch has not been deployed

No deployments
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.

Remove LRU block cache

2 participants