-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Replace synchronized multimap with concurrent hash map in NotificationControllerV2 for better performance #5532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughReplaces a synchronized TreeMultimap in NotificationControllerV2 with a new CaseInsensitiveMultimapWrapper backed by concurrent map/set implementations; adds the wrapper class and comprehensive tests, updates NotificationControllerV2 and its test, and adds a changelog entry describing the concurrency/performance change. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@apollo-configservice/src/test/java/com/ctrip/framework/apollo/configservice/wrapper/CaseInsensitiveMultimapWrapperTest.java`:
- Around line 158-167: The test fails because
CaseInsensitiveMultimapWrapper.get(...) returns a Collections.unmodifiableSet,
so asserting set instanceof HashSet is false; change the testCustomSetSupplier
to unwrap the returned unmodifiable set via reflection (the
Collections$UnmodifiableSet has a private field "c" referencing the original
set) and assert that the underlying "c" is a HashSet, or alternatively access
the wrapper's internal map entry for the key and assert that its value is a
HashSet; reference the test method testCustomSetSupplier,
CaseInsensitiveMultimapWrapper.get, and the Collections$UnmodifiableSet "c"
field when making the change.
...ava/com/ctrip/framework/apollo/configservice/wrapper/CaseInsensitiveMultimapWrapperTest.java
Show resolved
Hide resolved
…nControllerV2 for better performance
What's the purpose of this PR
Replace synchronized multimap with concurrent hash map in NotificationControllerV2 for better performance
Which issue(s) this PR fixes:
Fixes #5450
Brief changelog
Follow this checklist to help us incorporate your contribution quickly and easily:
mvn clean testto make sure this pull request doesn't break anything.mvn spotless:applyto format your code.CHANGESlog.Summary by CodeRabbit
Chores
New Features
Tests
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.