Skip to content
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 SPI precedence support and apply for transport SPI #675

Merged
merged 2 commits into from
Apr 17, 2019

Conversation

sczyh30
Copy link
Member

@sczyh30 sczyh30 commented Apr 17, 2019

Describe what this PR does / why we need it

Add @SpiOrder support and apply precedence support for transport SPI (CommandCenter, HeartbeatSender).

Does this pull request fix one issue?

NONE

Describe how you did it

  • Add a @SpiOrder annotation to indicate precedence. Also update SpiLoader to support get the SPI with the highest precedence.
  • Add precedence support for transport SPI (CommandCenter, HeartbeatSender). Two providers now will choose the instance with the highest precedence.

Describe how to verify it

Run a demo, put with two different transport modules, then see whether the SPI of higher order is activated.

Special notes for reviews

NONE

@sczyh30 sczyh30 added kind/enhancement Category issues or prs related to enhancement. to-review To review labels Apr 17, 2019
@sczyh30 sczyh30 added this to the 1.6.0 milestone Apr 17, 2019
@codecov-io
Copy link

codecov-io commented Apr 17, 2019

Codecov Report

Merging #675 into master will decrease coverage by 0.2%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #675      +/-   ##
============================================
- Coverage     41.04%   40.84%   -0.21%     
- Complexity     1212     1216       +4     
============================================
  Files           267      267              
  Lines          7854     7911      +57     
  Branches       1062     1072      +10     
============================================
+ Hits           3224     3231       +7     
- Misses         4234     4288      +54     
+ Partials        396      392       -4
Impacted Files Coverage Δ Complexity Δ
.../java/com/alibaba/csp/sentinel/util/SpiLoader.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...l/cluster/server/connection/ConnectionManager.java 76% <0%> (+2%) 11% <0%> (+1%) ⬆️
...ava/com/alibaba/csp/sentinel/node/ClusterNode.java 100% <0%> (+4.76%) 8% <0%> (+1%) ⬆️
...a/csp/sentinel/slots/statistic/base/LeapArray.java 72.54% <0%> (+4.9%) 35% <0%> (+2%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update df27e3e...c5e4a3a. Read the comment docs.

Copy link
Contributor

@CarpenterLee CarpenterLee left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Category issues or prs related to enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants