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

feature: StateHandlerInterceptor and StateRouterInterceptor support SPI #2584

Merged
merged 4 commits into from
Jun 17, 2020

Conversation

long187
Copy link
Contributor

@long187 long187 commented Apr 21, 2020

Ⅰ. Describe what this PR did

Optimize: Saga StateHandlerInterceptor and StateRouterInterceptor support SPI

Ⅳ. Describe how to verify it

  1. Add io.seata.saga.engine.pcext.StateHandlerInterceptor and io.seata.saga.engine.pcext.StateRouterInterceptor file at classpath:/META-INF/services/ directory
  2. File content is your implements of StateHandlerInterceptor and StateRouterInterceptor

Ⅴ. Special notes for reviews

see seata/test/src/test/resources/META-INF/services

@codecov-io
Copy link

Codecov Report

Merging #2584 into develop will decrease coverage by 0.14%.
The diff coverage is 100.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #2584      +/-   ##
=============================================
- Coverage      51.19%   51.04%   -0.15%     
+ Complexity      2806     2804       -2     
=============================================
  Files            554      554              
  Lines          17774    17774              
  Branches        2101     2072      -29     
=============================================
- Hits            9099     9073      -26     
- Misses          7817     7818       +1     
- Partials         858      883      +25     
Impacted Files Coverage Δ Complexity Δ
...ata/saga/proctrl/handler/DefaultRouterHandler.java 60.00% <100.00%> (ø) 7.00 <0.00> (ø)
...obuf/convertor/BranchRegisterRequestConvertor.java 90.47% <0.00%> (-9.53%) 3.00% <0.00%> (ø%)
...otobuf/convertor/GlobalBeginResponseConvertor.java 92.59% <0.00%> (-7.41%) 3.00% <0.00%> (ø%)
...otobuf/convertor/GlobalCommitRequestConvertor.java 93.75% <0.00%> (-6.25%) 3.00% <0.00%> (ø%)
...otobuf/convertor/GlobalStatusRequestConvertor.java 93.75% <0.00%> (-6.25%) 3.00% <0.00%> (ø%)
...obuf/convertor/GlobalRollbackRequestConvertor.java 93.75% <0.00%> (-6.25%) 3.00% <0.00%> (ø%)
...protobuf/convertor/RegisterTMRequestConvertor.java 94.73% <0.00%> (-5.27%) 3.00% <0.00%> (ø%)
...protobuf/convertor/RegisterRMRequestConvertor.java 90.47% <0.00%> (-4.77%) 3.00% <0.00%> (ø%)
...otobuf/convertor/BranchReportRequestConvertor.java 95.45% <0.00%> (-4.55%) 3.00% <0.00%> (ø%)
...tobuf/convertor/BranchReportResponseConvertor.java 95.45% <0.00%> (-4.55%) 3.00% <0.00%> (ø%)
... and 15 more

@l81893521 l81893521 added the module/saga saga module label May 20, 2020
@long187 long187 requested a review from slievrly June 17, 2020 08:40
@long187 long187 self-assigned this Jun 17, 2020
Copy link
Contributor

@zhangthen zhangthen left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov-commenter
Copy link

codecov-commenter commented Jun 17, 2020

Codecov Report

Merging #2584 into develop will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop    #2584   +/-   ##
==========================================
  Coverage      50.18%   50.18%           
- Complexity      2919     2921    +2     
==========================================
  Files            578      578           
  Lines          18724    18724           
  Branches        2253     2252    -1     
==========================================
  Hits            9396     9396           
  Misses          8396     8396           
  Partials         932      932           
Impacted Files Coverage Δ Complexity Δ
...ata/saga/proctrl/handler/DefaultRouterHandler.java 60.00% <100.00%> (ø) 7.00 <0.00> (ø)

@Override
public void addInterceptor(StateHandlerInterceptor interceptor) {
if (interceptors != null && !interceptors.contains(interceptor)) {
interceptors.add(interceptor);
Copy link
Member

Choose a reason for hiding this comment

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

Whether need to sort the interceptor?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorting has been done in EnhancedServiceLoader.findAllExtensionDefinition method

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

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

LGTM

@slievrly slievrly changed the title Optimize: Saga StateHandlerInterceptor and StateRouterInterceptor support SPI feature: Saga StateHandlerInterceptor and StateRouterInterceptor support SPI Jun 17, 2020
@slievrly slievrly changed the title feature: Saga StateHandlerInterceptor and StateRouterInterceptor support SPI feature: StateHandlerInterceptor and StateRouterInterceptor support SPI Jun 17, 2020
@slievrly slievrly merged commit 37d2ea6 into apache:develop Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/saga saga module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants