Skip to content

[Enhancement] Adding the overriding rule for ExtensionLoader#6068

Merged
chickenlj merged 8 commits intoapache:masterfrom
mercyblitz:2.7.7-refactor-extension-loader
Apr 29, 2020
Merged

[Enhancement] Adding the overriding rule for ExtensionLoader#6068
chickenlj merged 8 commits intoapache:masterfrom
mercyblitz:2.7.7-refactor-extension-loader

Conversation

@mercyblitz
Copy link
Copy Markdown
Contributor

ExtensionLoader is a core API to extend the features of Dubbo components, it's based on the Dubbo's Service Provider mechanism that will search three classpaths in order :

  1. META-INF/dubbo/internal/
  2. META-INF/dubbo/
  3. META-INF/services/

However, Dubbo framework just loads only one SPI file if found, does not support the overriding rule, for example :

The implementation in META-INF/services/ can override META-INF/dubbo/,
META-INF/dubbo/ can override META-INF/dubbo/internal/ .

@mercyblitz mercyblitz requested a review from chickenlj April 27, 2020 03:17
@mercyblitz mercyblitz linked an issue Apr 27, 2020 that may be closed by this pull request
@mercyblitz mercyblitz added this to the 2.7.7 milestone Apr 27, 2020
@qinliujie
Copy link
Copy Markdown
Contributor

I don't think it's necessary, and it make ExtensionLoader more complicated

@mercyblitz
Copy link
Copy Markdown
Contributor Author

mercyblitz commented Apr 27, 2020

I don't think it's necessary, and it make ExtensionLoader more complicated

Or change to be simpler, reduce three classpaths to be one:

  • META-INF/dubbo/internal/
  • META-INF/dubbo/
  • META-INF/services/

Just Leaving the first path will be better.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Apr 27, 2020

Codecov Report

Merging #6068 into master will decrease coverage by 0.00%.
The diff coverage is 82.35%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #6068      +/-   ##
============================================
- Coverage     60.97%   60.97%   -0.01%     
  Complexity      492      492              
============================================
  Files           992      995       +3     
  Lines         39690    39704      +14     
  Branches       5723     5723              
============================================
+ Hits          24202    24210       +8     
- Misses        12808    12811       +3     
- Partials       2680     2683       +3     
Impacted Files Coverage Δ Complexity Δ
...apache/dubbo/common/extension/ExtensionLoader.java 75.05% <70.00%> (-0.12%) 0.00 <0.00> (ø)
...common/extension/DubboInternalLoadingStrategy.java 100.00% <100.00%> (ø) 0.00 <0.00> (?)
...e/dubbo/common/extension/DubboLoadingStrategy.java 100.00% <100.00%> (ø) 0.00 <0.00> (?)
...apache/dubbo/common/extension/LoadingStrategy.java 100.00% <100.00%> (ø) 0.00 <0.00> (ø)
...ubbo/common/extension/ServicesLoadingStrategy.java 100.00% <100.00%> (ø) 0.00 <0.00> (?)
...dubbo/remoting/http/servlet/ServletHttpBinder.java 100.00% <100.00%> (ø) 0.00 <0.00> (ø)
...rg/apache/dubbo/remoting/utils/PayloadDropper.java 46.15% <0.00%> (-30.77%) 0.00% <0.00%> (ø%)
.../apache/dubbo/rpc/protocol/AsyncToSyncInvoker.java 72.41% <0.00%> (-10.35%) 0.00% <0.00%> (ø%)
...ng/exchange/support/header/HeartbeatTimerTask.java 73.68% <0.00%> (-5.27%) 0.00% <0.00%> (ø%)
...dubbo/remoting/exchange/support/DefaultFuture.java 79.31% <0.00%> (-3.45%) 0.00% <0.00%> (ø%)
... and 8 more

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 7e43315...0352fc5. Read the comment docs.

@chickenlj
Copy link
Copy Markdown
Contributor

Notice that LoadingStrategy is defined as Java standard SPI, which means ExtensionLoader, an enhanced version of SPI now relies on Java SPI to load.

@chickenlj chickenlj merged commit 7234078 into apache:master Apr 29, 2020
@mercyblitz mercyblitz deleted the 2.7.7-refactor-extension-loader branch June 8, 2020 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Adding the overriding rule for ExtensionLoader

4 participants