[Task] Remove the unused MemorySafeWindowTinyLFUMap implementation
Author: Aias00Created Sep 26, 2026Updated Sep 26, 2026
Labelsstatus: volunteer wantedtype: refactorlevel: easycode: cleancommonpriority: medium
Background
MemorySafeWindowTinyLFUMap is no longer referenced by production code. Repository-wide Java reference inspection finds only the class itself and its dedicated test. The class also owns global static state and lazily starts a scheduled executor, so retaining it adds lifecycle and memory-management complexity without serving the runtime.
The actively used cache implementation is WindowTinyLFUMap; it must remain unchanged.
Historical context: #4475 reported a memory-retention problem in this implementation.
Scope
- Delete
shenyu-common/src/main/java/org/apache/shenyu/common/cache/MemorySafeWindowTinyLFUMap.java. - Delete
shenyu-common/src/test/java/org/apache/shenyu/common/cache/MemorySafeWindowTinyLFUMapTest.java. - Remove any documentation, imports, reflection configuration, or generated references if found during implementation.
- Do not remove
WindowTinyLFUMapor the Caffeine dependency: both are still used by plugin-base selector/rule/metadata caches. - Do not replace the unused class with another abstraction.
Verification
- Run a repository-wide search proving no production or test references remain.
- Run
./mvnw test -pl shenyu-common. - Run targeted plugin-base cache tests because
WindowTinyLFUMapremains the active implementation. - Run Checkstyle and RAT for the affected modules.
Acceptance Criteria
- The unused implementation and its dedicated test are removed.
- No
MemorySafeWindowTinyLFUMapreference remains in tracked source or configuration. -
WindowTinyLFUMapbehavior and tests remain unchanged and green. -
shenyu-commonand plugin-base cache tests pass. - No replacement scheduler, compatibility shim, or dead facade is introduced.
Source: apache/shenyu