-
Notifications
You must be signed in to change notification settings - Fork 8k
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
Improve the parameter flow module and refactor API gateway adapter common module #758
Conversation
Signed-off-by: Eric Zhao <[email protected]>
…mFlowRuleUtil - Add a ParameterMetricStorage specific for caching ParameterMetric (moved from ParamSlot) - Add rule map building helper method in ParamFlowRuleUtil so that we can reuse it in other rule managers Signed-off-by: Eric Zhao <[email protected]>
…ther rule managers - Separate converted parameter rules from ParamFlowManager. Now the converted rules will be kept in GatewayRuleManager directly. - Add a GatewayFlowSlot to do separate flow checking for generated rules. - Refactor rule converting mechanism: now gateway rules in normal mode (without parameter) will also be converted to a parameter flow rule. The index will be the last (the last position). In GatewayParamParser we put a constant value to the last position. Signed-off-by: Eric Zhao <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #758 +/- ##
============================================
+ Coverage 41% 41.66% +0.65%
- Complexity 1335 1369 +34
============================================
Files 301 304 +3
Lines 8630 8767 +137
Branches 1159 1191 +32
============================================
+ Hits 3539 3653 +114
+ Misses 4666 4662 -4
- Partials 425 452 +27
Continue to review full report at Codecov.
|
.../test/java/com/alibaba/csp/sentinel/adapter/gateway/common/param/GatewayParamParserTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Eric Zhao <[email protected]>
430d0d9
to
6e794b8
Compare
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.
LGTM. Good works!
…a#758) [RIP-9] Add the introduction of the basic samples in RocketMQ
Describe what this PR does / why we need it
Improve the parameter flow module and refactor the API gateway adapter common module. See #756 for details.
Does this pull request fix one issue?
Resolves #756
Describe how you did it
FlowRuleChecker
to improve code reuse. AddcheckFlow
method to support applying rule retrieving function and then check.ParamFlowSlot
and improveParamFlowRuleUtil
ParameterMetricStorage
specific for caching ParameterMetric (moved from ParamSlot)ParamFlowRuleUtil
so that we can reuse it in other rule managersGatewayRuleManager
directly.GatewayFlowSlot
to do separate flow checking for generated rules.GatewayParamParser
we put a constant value to the last position to achieve the effect of non-param flow control.Describe how to verify it
Run the test cases and demo.
Special notes for reviews
Please take care of the internal breaking changes.