Skip to content

[ISSUE #7444] Deprecate unused memory-safe lru map. - #7553

Merged
Aias00 merged 1 commit into
apache:masterfrom
yangjj-iso:fix/7444-deprecate-lru-map
Oct 12, 2026
Merged

Aias00 merged 1 commit into
apache:masterfrom
yangjj-iso:fix/7444-deprecate-lru-map

Conversation

@yangjj-iso

Copy link
Copy Markdown
Contributor

MemorySafeLRUMap has no repository-local production callers, but it is still a public shenyu-common API. Deprecate it since 2.7.2 while retaining its constructors, serialization identifier, implementation and dedicated tests for downstream source and binary compatibility. Public code search also finds historical ShenYu copies and callers; that evidence cannot rule out private or binary-only consumers.

Add an Unreleased API note with migration guidance for the existing WindowTinyLFUMap: choose an explicit maximum entry count and review the different eviction policy, non-null keys/values and Map API surface. The old free-memory threshold is measured in bytes and is not an entry-count setting. Keep memory-pressure-dependent consumers on the compatibility implementation until an equivalent policy is chosen. No removal release is scheduled; future removal needs compatibility review and advance notice.

Fixes #7444.

Validation

  • Full shenyu-common suite: 498 tests, zero failures/errors, one existing skipped test (497 passed), including the retained LRU, WindowTinyLFU and memory-limit tests.
  • Checkstyle: zero violations. RAT: zero unapproved/unknown licenses. Javadoc generation succeeds.
  • javap -public signatures match the previously installed 2.7.2-SNAPSHOT artifact.
  • Repository-wide reference search covers Java, non-Java, hidden and configuration files; only the legacy class and its dedicated tests referenced it before this change.
  • git diff --check passes.
./mvnw -B -ntp -pl shenyu-common -Djacoco.skip=true test javadoc:javadoc apache-rat:check

Make sure that:

  • You have read the contribution guidelines.
  • Existing dedicated unit tests are retained and back this metadata/documentation-only change.
  • Your local test passed ./mvnw clean install -Dmaven.javadoc.skip=true. The full affected-module validation is recorded above; the full repository build was not run.

@Aias00 Aias00 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: Deprecate unused memory-safe lru map (#7444)

Approving. Clean, purely additive deprecation — no behavioral or API change.

What I verified:

  • MemorySafeLRUMap is annotated @Deprecated(since = "2.7.2") and the class Javadoc now documents the deprecation, the retention-for-compatibility guarantee (public constructors, serialization id, and behavior preserved; no removal scheduled without a public API review), and concrete migration guidance toward WindowTinyLFUMap with an explicit maximum entry count.
  • The RELEASE-NOTES entry is placed under API Changes and correctly emphasizes the key caveat: the old maxFreeMemory argument is a free-memory threshold in bytes, not an entry count, so migrating callers must choose an entry-count working set; WindowTinyLFUMap does not implement the memory-pressure threshold.
  • No source or binary compatibility is broken; down-stream code keeps compiling and running unchanged.

Non-blocking suggestion: when the eventual removal is planned, a quick rg sweep of the repo (and the shenyu-examples* / shenyu-web modules) for MemorySafeLRUMap usages would let you pre-file a migration PR for internal callers rather than bundling it with the removal. Not required now.

Merging.

@Aias00
Aias00 merged commit a89459b into apache:master Oct 12, 2026
47 checks passed
@Aias00 Aias00 added this to the 2.7.2 milestone Nov 13, 2026
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.

[Task] Deprecate unused MemorySafeLRUMap and plan compatibility-aware removal

3 participants