-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Add default cluster flow control implementation #294
Conversation
Codecov Report
@@ Coverage Diff @@
## master #294 +/- ##
============================================
- Coverage 45.78% 38.23% -7.56%
- Complexity 921 930 +9
============================================
Files 181 219 +38
Lines 5753 6921 +1168
Branches 832 939 +107
============================================
+ Hits 2634 2646 +12
- Misses 2787 3941 +1154
- Partials 332 334 +2
Continue to review full report at Codecov.
|
- Add a universal `TokenService` SPI interface for both local flow control and distributed flow control - Add TokenResult entity to represents result of acquiring token - Add `ClusterTokenClient` as the SPI interface for client of Sentinel cluster flow control Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Add new field `clusterMode` and `clusterConfig` for cluster mode - Add a `ClusterFlowConfig` class for specific items for cluster flow control - Update FlowRuleChecker to support cluster mode - Extract valid rule checking and rule map generating logic to FlowRuleUtil Signed-off-by: Eric Zhao <sczyh16@gmail.com>
…util class - Update ParamFlowRule to support cluster mode - Add `ParamFlowClusterConfig` to provide cluster mode items for the rule - Update ParamFlowChecker to support cluster flow mode - Extract ParamFlowRuleUtil class - Change type of `flowId` from Integer to Long Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Add a `ClusterTransportClient` for transport abstraction of Sentinel cluster - Add universal request/response interface and common ClusterRequest/ClusterResponse abstraction - Add common request/response data entity - Add basic abstraction of codec (EntityWriter and EntityDecoder) Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Add Netty transport client implementation and default cluster token client - Add config manager for cluster client - Add codec SPI mechanism for client entity decoder / writer Signed-off-by: Eric Zhao <sczyh16@gmail.com>
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Add `start` and `stop` method for automatic control - Update TokenClientProvider using SpiLoader Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Add a EmbeddedClusterTokenServer interface Signed-off-by: Eric Zhao <sczyh16@gmail.com>
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Remove "borrow-from-ref" mode - Improve flow checker to support both embedded server mode and client mode Signed-off-by: Eric Zhao <sczyh16@gmail.com>
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Add a `@RequestType` annotation for common use (e.g. request handler, encoder or decoder) - Add a registry for universal config supplier (e.g. namespace of client) Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Add exception item extracting method in ParamFlowRule Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Initial work Signed-off-by: Eric Zhao <sczyh16@gmail.com>
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Add several command handlers - Update cluster state manager Signed-off-by: Eric Zhao <sczyh16@gmail.com>
…cluster module Signed-off-by: Eric Zhao <sczyh16@gmail.com>
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
d112ed1
to
f01fe2b
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
- Add default cluster flow control implementation
…sg when… (alibaba#294) * Fix issue : duplicate compress message body if retry to send msg when exception occurs in async sending.
Describe what this PR does / why we need it
Add default cluster flow control implementation.
Does this pull request fix one issue?
Closes #293
Also related to #207
Describe how you did it
// TBD: detailed design and description notes
Architecture overview (transport):
Describe how to verify it
See test cases and demo.
Special notes for reviews
This is a very large PR containing features of multiple modules. It's NOT a good idea to submit such a large PR, but it's hard to separate this into small branches.