You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/08/09 08:45:22 UTC

[GitHub] [dubbo] CrazyHZM opened a new pull request #8455: 【3.0】Refactor reference config

CrazyHZM opened a new pull request #8455:
URL: https://github.com/apache/dubbo/pull/8455


   ## What is the purpose of the change
   1. Fix typo
   2. Clarify the relationship between methodmodel, ReferenceConfig, and MethodConfig
   3. Increase the readability of service references
   
   
   ## Brief changelog
   
   
   ## Verifying this change
   
   
   <!-- Follow this checklist to help us incorporate your contribution quickly and easily: -->
   
   ## Checklist
   - [x] Make sure there is a [GitHub_issue](https://github.com/apache/dubbo/issues) field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
   - [ ] Each commit in the pull request should have a meaningful subject line and body.
   - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [ ] Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
   - [ ] Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in [dubbo samples](https://github.com/apache/dubbo-samples) project.
   - [ ] Add some description to [dubbo-website](https://github.com/apache/dubbo-website) project if you are requesting to add a feature.
   - [ ] GitHub Actions works fine on your own branch.
   - [ ] If this contribution is large, please follow the [Software Donation Guide](https://github.com/apache/dubbo/wiki/Software-donation-guide).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] codecov-commenter edited a comment on pull request #8455: 【3.0】Refactor reference config

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #8455:
URL: https://github.com/apache/dubbo/pull/8455#issuecomment-895097422


   # [Codecov](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#8455](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7a71654) into [3.0](https://codecov.io/gh/apache/dubbo/commit/0a07eaee651a263fd05c1b173b29ed220539d4dd?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0a07eae) will **decrease** coverage by `0.22%`.
   > The diff coverage is `63.19%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo/pull/8455/graphs/tree.svg?width=650&height=150&src=pr&token=VnEIkiFQT0&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##                3.0    #8455      +/-   ##
   ============================================
   - Coverage     63.30%   63.08%   -0.23%     
     Complexity      312      312              
   ============================================
     Files          1104     1111       +7     
     Lines         46258    46486     +228     
     Branches       6977     7002      +25     
   ============================================
   + Hits          29282    29324      +42     
   - Misses        13708    13901     +193     
   + Partials       3268     3261       -7     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...g/apache/dubbo/config/AbstractInterfaceConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvQWJzdHJhY3RJbnRlcmZhY2VDb25maWcuamF2YQ==) | `86.75% <0.00%> (ø)` | |
   | [...e/dubbo/registry/integration/RegistryProtocol.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9pbnRlZ3JhdGlvbi9SZWdpc3RyeVByb3RvY29sLmphdmE=) | `59.27% <ø> (ø)` | |
   | [...n/java/org/apache/dubbo/config/AbstractConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvQWJzdHJhY3RDb25maWcuamF2YQ==) | `81.03% <31.57%> (+0.41%)` | :arrow_up: |
   | [...ain/java/org/apache/dubbo/config/MethodConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvTWV0aG9kQ29uZmlnLmphdmE=) | `84.31% <65.21%> (-3.57%)` | :arrow_down: |
   | [.../java/org/apache/dubbo/config/ReferenceConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29uZmlnL2R1YmJvLWNvbmZpZy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL2NvbmZpZy9SZWZlcmVuY2VDb25maWcuamF2YQ==) | `76.07% <65.93%> (+1.07%)` | :arrow_up: |
   | [...a/org/apache/dubbo/config/ReferenceConfigBase.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvUmVmZXJlbmNlQ29uZmlnQmFzZS5qYXZh) | `69.49% <100.00%> (ø)` | |
   | [...java/org/apache/dubbo/rpc/model/ConsumerModel.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9ycGMvbW9kZWwvQ29uc3VtZXJNb2RlbC5qYXZh) | `55.38% <100.00%> (+5.38%)` | :arrow_up: |
   | [...ing/context/DubboBootstrapApplicationListener.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29uZmlnL2R1YmJvLWNvbmZpZy1zcHJpbmcvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL2NvbmZpZy9zcHJpbmcvY29udGV4dC9EdWJib0Jvb3RzdHJhcEFwcGxpY2F0aW9uTGlzdGVuZXIuamF2YQ==) | `60.00% <0.00%> (-22.00%)` | :arrow_down: |
   | [...he/dubbo/common/config/CompositeConfiguration.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb21tb24vY29uZmlnL0NvbXBvc2l0ZUNvbmZpZ3VyYXRpb24uamF2YQ==) | `46.42% <0.00%> (-14.29%)` | :arrow_down: |
   | [...ng/transport/dispatcher/all/AllChannelHandler.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvZGlzcGF0Y2hlci9hbGwvQWxsQ2hhbm5lbEhhbmRsZXIuamF2YQ==) | `82.75% <0.00%> (-6.90%)` | :arrow_down: |
   | ... and [37 more](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [0a07eae...7a71654](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] codecov-commenter commented on pull request #8455: 【3.0】Refactor reference config

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #8455:
URL: https://github.com/apache/dubbo/pull/8455#issuecomment-895097422


   # [Codecov](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#8455](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (46629cf) into [3.0](https://codecov.io/gh/apache/dubbo/commit/0a07eaee651a263fd05c1b173b29ed220539d4dd?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0a07eae) will **decrease** coverage by `0.18%`.
   > The diff coverage is `61.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo/pull/8455/graphs/tree.svg?width=650&height=150&src=pr&token=VnEIkiFQT0&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##                3.0    #8455      +/-   ##
   ============================================
   - Coverage     63.26%   63.08%   -0.19%     
   + Complexity      312      309       -3     
   ============================================
     Files          1104     1104              
     Lines         46258    46263       +5     
     Branches       6977     6957      -20     
   ============================================
   - Hits          29267    29184      -83     
   - Misses        13723    13794      +71     
   - Partials       3268     3285      +17     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...g/apache/dubbo/config/AbstractInterfaceConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvQWJzdHJhY3RJbnRlcmZhY2VDb25maWcuamF2YQ==) | `86.75% <0.00%> (ø)` | |
   | [...e/dubbo/registry/integration/RegistryProtocol.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9pbnRlZ3JhdGlvbi9SZWdpc3RyeVByb3RvY29sLmphdmE=) | `59.27% <ø> (ø)` | |
   | [...n/java/org/apache/dubbo/config/AbstractConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvQWJzdHJhY3RDb25maWcuamF2YQ==) | `81.65% <31.57%> (+1.02%)` | :arrow_up: |
   | [.../java/org/apache/dubbo/config/ReferenceConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29uZmlnL2R1YmJvLWNvbmZpZy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL2NvbmZpZy9SZWZlcmVuY2VDb25maWcuamF2YQ==) | `75.11% <63.73%> (+0.11%)` | :arrow_up: |
   | [...ain/java/org/apache/dubbo/config/MethodConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvTWV0aG9kQ29uZmlnLmphdmE=) | `84.31% <65.21%> (-3.57%)` | :arrow_down: |
   | [...a/org/apache/dubbo/config/ReferenceConfigBase.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvUmVmZXJlbmNlQ29uZmlnQmFzZS5qYXZh) | `69.49% <100.00%> (ø)` | |
   | [...java/org/apache/dubbo/rpc/model/ConsumerModel.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9ycGMvbW9kZWwvQ29uc3VtZXJNb2RlbC5qYXZh) | `55.38% <100.00%> (+5.38%)` | :arrow_up: |
   | [...ng/transport/dispatcher/all/AllChannelHandler.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvZGlzcGF0Y2hlci9hbGwvQWxsQ2hhbm5lbEhhbmRsZXIuamF2YQ==) | `62.06% <0.00%> (-20.69%)` | :arrow_down: |
   | [...dubbo/common/status/support/LoadStatusChecker.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb21tb24vc3RhdHVzL3N1cHBvcnQvTG9hZFN0YXR1c0NoZWNrZXIuamF2YQ==) | `46.15% <0.00%> (-15.39%)` | :arrow_down: |
   | [...ng/transport/dispatcher/WrappedChannelHandler.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvZGlzcGF0Y2hlci9XcmFwcGVkQ2hhbm5lbEhhbmRsZXIuamF2YQ==) | `43.47% <0.00%> (-15.22%)` | :arrow_down: |
   | ... and [33 more](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [0a07eae...46629cf](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] codecov-commenter edited a comment on pull request #8455: 【3.0】Refactor reference config

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #8455:
URL: https://github.com/apache/dubbo/pull/8455#issuecomment-895097422


   # [Codecov](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#8455](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (46629cf) into [3.0](https://codecov.io/gh/apache/dubbo/commit/0a07eaee651a263fd05c1b173b29ed220539d4dd?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0a07eae) will **decrease** coverage by `0.01%`.
   > The diff coverage is `61.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo/pull/8455/graphs/tree.svg?width=650&height=150&src=pr&token=VnEIkiFQT0&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##                3.0    #8455      +/-   ##
   ============================================
   - Coverage     63.28%   63.26%   -0.02%     
   + Complexity      312      311       -1     
   ============================================
     Files          1104     1104              
     Lines         46258    46263       +5     
     Branches       6977     6978       +1     
   ============================================
   - Hits          29273    29268       -5     
   - Misses        13715    13723       +8     
   - Partials       3270     3272       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...g/apache/dubbo/config/AbstractInterfaceConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvQWJzdHJhY3RJbnRlcmZhY2VDb25maWcuamF2YQ==) | `86.75% <0.00%> (ø)` | |
   | [...e/dubbo/registry/integration/RegistryProtocol.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9pbnRlZ3JhdGlvbi9SZWdpc3RyeVByb3RvY29sLmphdmE=) | `59.27% <ø> (ø)` | |
   | [...n/java/org/apache/dubbo/config/AbstractConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvQWJzdHJhY3RDb25maWcuamF2YQ==) | `81.65% <31.57%> (+1.02%)` | :arrow_up: |
   | [.../java/org/apache/dubbo/config/ReferenceConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29uZmlnL2R1YmJvLWNvbmZpZy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL2NvbmZpZy9SZWZlcmVuY2VDb25maWcuamF2YQ==) | `75.11% <63.73%> (+0.11%)` | :arrow_up: |
   | [...ain/java/org/apache/dubbo/config/MethodConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvTWV0aG9kQ29uZmlnLmphdmE=) | `84.31% <65.21%> (-3.57%)` | :arrow_down: |
   | [...a/org/apache/dubbo/config/ReferenceConfigBase.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvUmVmZXJlbmNlQ29uZmlnQmFzZS5qYXZh) | `69.49% <100.00%> (ø)` | |
   | [...java/org/apache/dubbo/rpc/model/ConsumerModel.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9ycGMvbW9kZWwvQ29uc3VtZXJNb2RlbC5qYXZh) | `55.38% <100.00%> (+5.38%)` | :arrow_up: |
   | [...he/dubbo/remoting/transport/netty/NettyServer.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctbmV0dHkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JlbW90aW5nL3RyYW5zcG9ydC9uZXR0eS9OZXR0eVNlcnZlci5qYXZh) | `70.17% <0.00%> (-3.51%)` | :arrow_down: |
   | [...c/main/java/org/apache/dubbo/rpc/RpcException.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9ScGNFeGNlcHRpb24uamF2YQ==) | `80.00% <0.00%> (-3.34%)` | :arrow_down: |
   | [...va/org/apache/dubbo/registry/RegistryNotifier.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9SZWdpc3RyeU5vdGlmaWVyLmphdmE=) | `82.85% <0.00%> (-2.86%)` | :arrow_down: |
   | ... and [7 more](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [0a07eae...46629cf](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] kylixs commented on a change in pull request #8455: 【3.0】Refactor reference config

Posted by GitBox <gi...@apache.org>.
kylixs commented on a change in pull request #8455:
URL: https://github.com/apache/dubbo/pull/8455#discussion_r686480018



##########
File path: dubbo-common/src/main/java/org/apache/dubbo/rpc/model/ConsumerModel.java
##########
@@ -64,7 +66,20 @@ public ConsumerModel(String serviceKey
         this.referenceConfig = referenceConfig;
     }
 
-    public void init(Map<String, AsyncMethodInfo> attributes) {
+
+    public void initMethodModels(List<MethodConfig> methodConfigs) {
+
+        Map<String, AsyncMethodInfo> attributes = null;
+        if (CollectionUtils.isNotEmpty(methodConfigs)) {
+            attributes = new HashMap<>(16);
+            for (MethodConfig methodConfig : methodConfigs) {
+                AsyncMethodInfo asyncMethodInfo = methodConfig.convertMethodConfig2AsyncInfo();

Review comment:
       I think the model class should be as simple as possible, it is best to convert `MethodConfig` first, and then pass it to `ConsumerModel`.

##########
File path: dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java
##########
@@ -305,143 +330,153 @@ protected synchronized void init() {
                         map.put(methodConfig.getName() + ".retries", "0");
                     }
                 }
-                AsyncMethodInfo asyncMethodInfo = AbstractConfig.convertMethodConfig2AsyncInfo(methodConfig);
-                if (asyncMethodInfo != null) {
-//                    consumerModel.getMethodModel(methodConfig.getName()).addAttribute(ASYNC_KEY, asyncMethodInfo);
-                    attributes.put(methodConfig.getName(), asyncMethodInfo);
-                }
             }
         }
 
-        String hostToRegistry = ConfigUtils.getSystemProperty(DUBBO_IP_TO_REGISTRY);
-        if (StringUtils.isEmpty(hostToRegistry)) {
-            hostToRegistry = NetUtils.getLocalHost();
-        } else if (isInvalidLocalHost(hostToRegistry)) {
-            throw new IllegalArgumentException(
-                    "Specified invalid registry ip from property:" + DUBBO_IP_TO_REGISTRY + ", value:" + hostToRegistry);
-        }
-        map.put(REGISTER_IP_KEY, hostToRegistry);
+        return map;
+    }
 
-        serviceMetadata.getAttachments().putAll(map);
+    @SuppressWarnings({"unchecked"})
+    private T createProxy(Map<String, String> referenceParameters) {
+        if (shouldJvmRefer(referenceParameters)) {
+            createInvokerForLocal(referenceParameters);
+        } else {
+            urls.clear();
+            if (url != null && url.length() > 0) {
+                // user specified URL, could be peer-to-peer address, or register center's address.
+                parseUrl(referenceParameters);
+            } else {
+                // if protocols not in jvm checkRegistry
+                if (!LOCAL_PROTOCOL.equalsIgnoreCase(getProtocol())) {
+                    AggregateUrlFromRegistry(referenceParameters);
+                }
+            }
+            createInvokerForRemote();
+        }
 
-        ref = createProxy(map);
+        if (logger.isInfoEnabled()) {
+            logger.info("Referred dubbo service " + interfaceClass.getName());
+        }
 
-        serviceMetadata.setTarget(ref);
-        serviceMetadata.addAttribute(PROXY_CLASS_REF, ref);
-        ConsumerModel consumerModel = repository.lookupReferredService(serviceMetadata.getServiceKey());
-        consumerModel.setProxyObject(ref);
-        consumerModel.init(attributes);
+        URL consumerUrl = new ServiceConfigURL(CONSUMER_PROTOCOL, referenceParameters.get(REGISTER_IP_KEY), 0,
+            referenceParameters.get(INTERFACE_KEY), referenceParameters);
+        MetadataUtils.publishServiceDefinition(consumerUrl);
 
-        initialized = true;
+        // create service proxy
+        return (T) PROXY_FACTORY.getProxy(invoker, ProtocolUtils.isGeneric(generic));
+    }
 
-        checkInvokerAvailable();
+    /**
+     * Make a local reference, create a local invoker.
+     *
+     * @param referenceParameters
+     */
+    private void createInvokerForLocal(Map<String, String> referenceParameters) {
+        URL url = new ServiceConfigURL(LOCAL_PROTOCOL, LOCALHOST_VALUE, 0, interfaceClass.getName()).addParameters(referenceParameters);
+        invoker = REF_PROTOCOL.refer(interfaceClass, url);
+        if (logger.isInfoEnabled()) {
+            logger.info("Using in jvm service " + interfaceClass.getName());
+        }
     }
 
-    @SuppressWarnings({"unchecked", "rawtypes", "deprecation"})
-    private T createProxy(Map<String, String> map) {
-        if (shouldJvmRefer(map)) {
-            URL url = new ServiceConfigURL(LOCAL_PROTOCOL, LOCALHOST_VALUE, 0, interfaceClass.getName()).addParameters(map);
-            invoker = REF_PROTOCOL.refer(interfaceClass, url);
-            if (logger.isInfoEnabled()) {
-                logger.info("Using injvm service " + interfaceClass.getName());
-            }
-        } else {
-            urls.clear();
-            if (url != null && url.length() > 0) { // user specified URL, could be peer-to-peer address, or register center's address.
-                String[] us = SEMICOLON_SPLIT_PATTERN.split(url);
-                if (us != null && us.length > 0) {
-                    for (String u : us) {
-                        URL url = URL.valueOf(u);
-                        if (StringUtils.isEmpty(url.getPath())) {
-                            url = url.setPath(interfaceName);
-                        }
-                        if (UrlUtils.isRegistry(url)) {
-                            urls.add(url.putAttribute(REFER_KEY, map));
-                        } else {
-                            URL peerURL = ClusterUtils.mergeUrl(url, map);
-                            peerURL = peerURL.putAttribute(PEER_KEY, true);
-                            urls.add(peerURL);
-                        }
-                    }
+    /**
+     * Parse the directly configured url.
+     */
+    private void parseUrl(Map<String, String> referenceParameters) {
+        String[] us = SEMICOLON_SPLIT_PATTERN.split(url);
+        if (us != null && us.length > 0) {
+            for (String u : us) {
+                URL url = URL.valueOf(u);
+                if (StringUtils.isEmpty(url.getPath())) {
+                    url = url.setPath(interfaceName);
                 }
-            } else { // assemble URL from register center's configuration
-                // if protocols not injvm checkRegistry
-                if (!LOCAL_PROTOCOL.equalsIgnoreCase(getProtocol())) {
-                    checkRegistry();
-                    List<URL> us = ConfigValidationUtils.loadRegistries(this, false);
-                    if (CollectionUtils.isNotEmpty(us)) {
-                        for (URL u : us) {
-                            URL monitorUrl = ConfigValidationUtils.loadMonitor(this, u);
-                            if (monitorUrl != null) {
-                                u = u.putAttribute(MONITOR_KEY, monitorUrl);
-                            }
-                            urls.add(u.putAttribute(REFER_KEY, map));
-                        }
-                    }
-                    if (urls.isEmpty()) {
-                        throw new IllegalStateException(
-                                "No such any registry to reference " + interfaceName + " on the consumer " + NetUtils.getLocalHost() +
-                                        " use dubbo version " + Version.getVersion() +
-                                        ", please config <dubbo:registry address=\"...\" /> to your spring config.");
-                    }
+                if (UrlUtils.isRegistry(url)) {
+                    urls.add(url.putAttribute(REFER_KEY, referenceParameters));
+                } else {
+                    URL peerUrl = ClusterUtils.mergeUrl(url, referenceParameters);
+                    peerUrl = peerUrl.putAttribute(PEER_KEY, true);
+                    urls.add(peerUrl);
                 }
             }
+        }
+    }
 
-            if (urls.size() == 1) {
-                invoker = REF_PROTOCOL.refer(interfaceClass, urls.get(0));
-            } else {
-                List<Invoker<?>> invokers = new ArrayList<Invoker<?>>();
-                URL registryURL = null;
-                for (URL url : urls) {
-                    // For multi-registry scenarios, it is not checked whether each referInvoker is available.
-                    // Because this invoker may become available later.
-                    invokers.add(REF_PROTOCOL.refer(interfaceClass, url));
-
-                    if (UrlUtils.isRegistry(url)) {
-                        registryURL = url; // use last registry url
-                    }
-                }
-
-                if (registryURL != null) { // registry url is available
-                    // for multi-subscription scenario, use 'zone-aware' policy by default
-                    String cluster = registryURL.getParameter(CLUSTER_KEY, ZoneAwareCluster.NAME);
-                    // The invoker wrap sequence would be: ZoneAwareClusterInvoker(StaticDirectory) -> FailoverClusterInvoker(RegistryDirectory, routing happens here) -> Invoker
-                    invoker = Cluster.getCluster(cluster, false).join(new StaticDirectory(registryURL, invokers));
-                } else { // not a registry url, must be direct invoke.
-                    String cluster = CollectionUtils.isNotEmpty(invokers)
-                            ?
-                            (invokers.get(0).getUrl() != null ? invokers.get(0).getUrl().getParameter(CLUSTER_KEY, ZoneAwareCluster.NAME) :
-                                    Cluster.DEFAULT)
-                            : Cluster.DEFAULT;
-                    invoker = Cluster.getCluster(cluster).join(new StaticDirectory(invokers));
+    /**
+     * Get URLs from the registry and aggregate them.
+     */
+    private void AggregateUrlFromRegistry(Map<String, String> referenceParameters) {

Review comment:
       The method name should be `camelCase`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] codecov-commenter edited a comment on pull request #8455: 【3.0】Refactor reference config

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #8455:
URL: https://github.com/apache/dubbo/pull/8455#issuecomment-895097422


   # [Codecov](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#8455](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7a71654) into [3.0](https://codecov.io/gh/apache/dubbo/commit/0a07eaee651a263fd05c1b173b29ed220539d4dd?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0a07eae) will **decrease** coverage by `0.41%`.
   > The diff coverage is `65.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo/pull/8455/graphs/tree.svg?width=650&height=150&src=pr&token=VnEIkiFQT0&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##                3.0    #8455      +/-   ##
   ============================================
   - Coverage     63.30%   62.88%   -0.42%     
     Complexity      312      312              
   ============================================
     Files          1104     1111       +7     
     Lines         46258    46440     +182     
     Branches       6977     6969       -8     
   ============================================
   - Hits          29282    29205      -77     
   - Misses        13708    13966     +258     
   - Partials       3268     3269       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...g/apache/dubbo/config/AbstractInterfaceConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvQWJzdHJhY3RJbnRlcmZhY2VDb25maWcuamF2YQ==) | `86.75% <0.00%> (ø)` | |
   | [...e/dubbo/registry/integration/RegistryProtocol.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9pbnRlZ3JhdGlvbi9SZWdpc3RyeVByb3RvY29sLmphdmE=) | `59.27% <ø> (ø)` | |
   | [...n/java/org/apache/dubbo/config/AbstractConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvQWJzdHJhY3RDb25maWcuamF2YQ==) | `81.03% <31.57%> (+0.41%)` | :arrow_up: |
   | [...ain/java/org/apache/dubbo/config/MethodConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvTWV0aG9kQ29uZmlnLmphdmE=) | `84.31% <65.21%> (-3.57%)` | :arrow_down: |
   | [.../java/org/apache/dubbo/config/ReferenceConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29uZmlnL2R1YmJvLWNvbmZpZy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL2NvbmZpZy9SZWZlcmVuY2VDb25maWcuamF2YQ==) | `77.07% <68.96%> (+2.07%)` | :arrow_up: |
   | [...a/org/apache/dubbo/config/ReferenceConfigBase.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvUmVmZXJlbmNlQ29uZmlnQmFzZS5qYXZh) | `69.49% <100.00%> (ø)` | |
   | [...java/org/apache/dubbo/rpc/model/ConsumerModel.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9ycGMvbW9kZWwvQ29uc3VtZXJNb2RlbC5qYXZh) | `55.38% <100.00%> (+5.38%)` | :arrow_up: |
   | [...ng/transport/dispatcher/all/AllChannelHandler.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvZGlzcGF0Y2hlci9hbGwvQWxsQ2hhbm5lbEhhbmRsZXIuamF2YQ==) | `62.06% <0.00%> (-27.59%)` | :arrow_down: |
   | [...ing/context/DubboBootstrapApplicationListener.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29uZmlnL2R1YmJvLWNvbmZpZy1zcHJpbmcvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL2NvbmZpZy9zcHJpbmcvY29udGV4dC9EdWJib0Jvb3RzdHJhcEFwcGxpY2F0aW9uTGlzdGVuZXIuamF2YQ==) | `60.00% <0.00%> (-22.00%)` | :arrow_down: |
   | [...ng/transport/dispatcher/WrappedChannelHandler.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvZGlzcGF0Y2hlci9XcmFwcGVkQ2hhbm5lbEhhbmRsZXIuamF2YQ==) | `43.47% <0.00%> (-15.22%)` | :arrow_down: |
   | ... and [75 more](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [0a07eae...7a71654](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] codecov-commenter edited a comment on pull request #8455: 【3.0】Refactor reference config

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #8455:
URL: https://github.com/apache/dubbo/pull/8455#issuecomment-895097422


   # [Codecov](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#8455](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (46629cf) into [3.0](https://codecov.io/gh/apache/dubbo/commit/0a07eaee651a263fd05c1b173b29ed220539d4dd?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0a07eae) will **decrease** coverage by `0.01%`.
   > The diff coverage is `61.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo/pull/8455/graphs/tree.svg?width=650&height=150&src=pr&token=VnEIkiFQT0&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##                3.0    #8455      +/-   ##
   ============================================
   - Coverage     63.28%   63.26%   -0.02%     
   + Complexity      312      311       -1     
   ============================================
     Files          1104     1104              
     Lines         46258    46263       +5     
     Branches       6977     6978       +1     
   ============================================
   - Hits          29273    29270       -3     
   - Misses        13715    13723       +8     
     Partials       3270     3270              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...g/apache/dubbo/config/AbstractInterfaceConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvQWJzdHJhY3RJbnRlcmZhY2VDb25maWcuamF2YQ==) | `86.75% <0.00%> (ø)` | |
   | [...e/dubbo/registry/integration/RegistryProtocol.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9pbnRlZ3JhdGlvbi9SZWdpc3RyeVByb3RvY29sLmphdmE=) | `59.27% <ø> (ø)` | |
   | [...n/java/org/apache/dubbo/config/AbstractConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvQWJzdHJhY3RDb25maWcuamF2YQ==) | `81.65% <31.57%> (+1.02%)` | :arrow_up: |
   | [.../java/org/apache/dubbo/config/ReferenceConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29uZmlnL2R1YmJvLWNvbmZpZy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL2NvbmZpZy9SZWZlcmVuY2VDb25maWcuamF2YQ==) | `75.11% <63.73%> (+0.11%)` | :arrow_up: |
   | [...ain/java/org/apache/dubbo/config/MethodConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvTWV0aG9kQ29uZmlnLmphdmE=) | `84.31% <65.21%> (-3.57%)` | :arrow_down: |
   | [...a/org/apache/dubbo/config/ReferenceConfigBase.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvUmVmZXJlbmNlQ29uZmlnQmFzZS5qYXZh) | `69.49% <100.00%> (ø)` | |
   | [...java/org/apache/dubbo/rpc/model/ConsumerModel.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9ycGMvbW9kZWwvQ29uc3VtZXJNb2RlbC5qYXZh) | `55.38% <100.00%> (+5.38%)` | :arrow_up: |
   | [...he/dubbo/remoting/transport/netty/NettyServer.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctbmV0dHkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JlbW90aW5nL3RyYW5zcG9ydC9uZXR0eS9OZXR0eVNlcnZlci5qYXZh) | `70.17% <0.00%> (-3.51%)` | :arrow_down: |
   | [...va/org/apache/dubbo/registry/RegistryNotifier.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9SZWdpc3RyeU5vdGlmaWVyLmphdmE=) | `82.85% <0.00%> (-2.86%)` | :arrow_down: |
   | [...pache/dubbo/registry/support/AbstractRegistry.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9zdXBwb3J0L0Fic3RyYWN0UmVnaXN0cnkuamF2YQ==) | `76.64% <0.00%> (-1.46%)` | :arrow_down: |
   | ... and [6 more](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [0a07eae...46629cf](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] CrazyHZM commented on a change in pull request #8455: 【3.0】Refactor reference config

Posted by GitBox <gi...@apache.org>.
CrazyHZM commented on a change in pull request #8455:
URL: https://github.com/apache/dubbo/pull/8455#discussion_r686487033



##########
File path: dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java
##########
@@ -305,143 +330,153 @@ protected synchronized void init() {
                         map.put(methodConfig.getName() + ".retries", "0");
                     }
                 }
-                AsyncMethodInfo asyncMethodInfo = AbstractConfig.convertMethodConfig2AsyncInfo(methodConfig);
-                if (asyncMethodInfo != null) {
-//                    consumerModel.getMethodModel(methodConfig.getName()).addAttribute(ASYNC_KEY, asyncMethodInfo);
-                    attributes.put(methodConfig.getName(), asyncMethodInfo);
-                }
             }
         }
 
-        String hostToRegistry = ConfigUtils.getSystemProperty(DUBBO_IP_TO_REGISTRY);
-        if (StringUtils.isEmpty(hostToRegistry)) {
-            hostToRegistry = NetUtils.getLocalHost();
-        } else if (isInvalidLocalHost(hostToRegistry)) {
-            throw new IllegalArgumentException(
-                    "Specified invalid registry ip from property:" + DUBBO_IP_TO_REGISTRY + ", value:" + hostToRegistry);
-        }
-        map.put(REGISTER_IP_KEY, hostToRegistry);
+        return map;
+    }
 
-        serviceMetadata.getAttachments().putAll(map);
+    @SuppressWarnings({"unchecked"})
+    private T createProxy(Map<String, String> referenceParameters) {
+        if (shouldJvmRefer(referenceParameters)) {
+            createInvokerForLocal(referenceParameters);
+        } else {
+            urls.clear();
+            if (url != null && url.length() > 0) {
+                // user specified URL, could be peer-to-peer address, or register center's address.
+                parseUrl(referenceParameters);
+            } else {
+                // if protocols not in jvm checkRegistry
+                if (!LOCAL_PROTOCOL.equalsIgnoreCase(getProtocol())) {
+                    AggregateUrlFromRegistry(referenceParameters);
+                }
+            }
+            createInvokerForRemote();
+        }
 
-        ref = createProxy(map);
+        if (logger.isInfoEnabled()) {
+            logger.info("Referred dubbo service " + interfaceClass.getName());
+        }
 
-        serviceMetadata.setTarget(ref);
-        serviceMetadata.addAttribute(PROXY_CLASS_REF, ref);
-        ConsumerModel consumerModel = repository.lookupReferredService(serviceMetadata.getServiceKey());
-        consumerModel.setProxyObject(ref);
-        consumerModel.init(attributes);
+        URL consumerUrl = new ServiceConfigURL(CONSUMER_PROTOCOL, referenceParameters.get(REGISTER_IP_KEY), 0,
+            referenceParameters.get(INTERFACE_KEY), referenceParameters);
+        MetadataUtils.publishServiceDefinition(consumerUrl);
 
-        initialized = true;
+        // create service proxy
+        return (T) PROXY_FACTORY.getProxy(invoker, ProtocolUtils.isGeneric(generic));
+    }
 
-        checkInvokerAvailable();
+    /**
+     * Make a local reference, create a local invoker.
+     *
+     * @param referenceParameters
+     */
+    private void createInvokerForLocal(Map<String, String> referenceParameters) {
+        URL url = new ServiceConfigURL(LOCAL_PROTOCOL, LOCALHOST_VALUE, 0, interfaceClass.getName()).addParameters(referenceParameters);
+        invoker = REF_PROTOCOL.refer(interfaceClass, url);
+        if (logger.isInfoEnabled()) {
+            logger.info("Using in jvm service " + interfaceClass.getName());
+        }
     }
 
-    @SuppressWarnings({"unchecked", "rawtypes", "deprecation"})
-    private T createProxy(Map<String, String> map) {
-        if (shouldJvmRefer(map)) {
-            URL url = new ServiceConfigURL(LOCAL_PROTOCOL, LOCALHOST_VALUE, 0, interfaceClass.getName()).addParameters(map);
-            invoker = REF_PROTOCOL.refer(interfaceClass, url);
-            if (logger.isInfoEnabled()) {
-                logger.info("Using injvm service " + interfaceClass.getName());
-            }
-        } else {
-            urls.clear();
-            if (url != null && url.length() > 0) { // user specified URL, could be peer-to-peer address, or register center's address.
-                String[] us = SEMICOLON_SPLIT_PATTERN.split(url);
-                if (us != null && us.length > 0) {
-                    for (String u : us) {
-                        URL url = URL.valueOf(u);
-                        if (StringUtils.isEmpty(url.getPath())) {
-                            url = url.setPath(interfaceName);
-                        }
-                        if (UrlUtils.isRegistry(url)) {
-                            urls.add(url.putAttribute(REFER_KEY, map));
-                        } else {
-                            URL peerURL = ClusterUtils.mergeUrl(url, map);
-                            peerURL = peerURL.putAttribute(PEER_KEY, true);
-                            urls.add(peerURL);
-                        }
-                    }
+    /**
+     * Parse the directly configured url.
+     */
+    private void parseUrl(Map<String, String> referenceParameters) {
+        String[] us = SEMICOLON_SPLIT_PATTERN.split(url);
+        if (us != null && us.length > 0) {
+            for (String u : us) {
+                URL url = URL.valueOf(u);
+                if (StringUtils.isEmpty(url.getPath())) {
+                    url = url.setPath(interfaceName);
                 }
-            } else { // assemble URL from register center's configuration
-                // if protocols not injvm checkRegistry
-                if (!LOCAL_PROTOCOL.equalsIgnoreCase(getProtocol())) {
-                    checkRegistry();
-                    List<URL> us = ConfigValidationUtils.loadRegistries(this, false);
-                    if (CollectionUtils.isNotEmpty(us)) {
-                        for (URL u : us) {
-                            URL monitorUrl = ConfigValidationUtils.loadMonitor(this, u);
-                            if (monitorUrl != null) {
-                                u = u.putAttribute(MONITOR_KEY, monitorUrl);
-                            }
-                            urls.add(u.putAttribute(REFER_KEY, map));
-                        }
-                    }
-                    if (urls.isEmpty()) {
-                        throw new IllegalStateException(
-                                "No such any registry to reference " + interfaceName + " on the consumer " + NetUtils.getLocalHost() +
-                                        " use dubbo version " + Version.getVersion() +
-                                        ", please config <dubbo:registry address=\"...\" /> to your spring config.");
-                    }
+                if (UrlUtils.isRegistry(url)) {
+                    urls.add(url.putAttribute(REFER_KEY, referenceParameters));
+                } else {
+                    URL peerUrl = ClusterUtils.mergeUrl(url, referenceParameters);
+                    peerUrl = peerUrl.putAttribute(PEER_KEY, true);
+                    urls.add(peerUrl);
                 }
             }
+        }
+    }
 
-            if (urls.size() == 1) {
-                invoker = REF_PROTOCOL.refer(interfaceClass, urls.get(0));
-            } else {
-                List<Invoker<?>> invokers = new ArrayList<Invoker<?>>();
-                URL registryURL = null;
-                for (URL url : urls) {
-                    // For multi-registry scenarios, it is not checked whether each referInvoker is available.
-                    // Because this invoker may become available later.
-                    invokers.add(REF_PROTOCOL.refer(interfaceClass, url));
-
-                    if (UrlUtils.isRegistry(url)) {
-                        registryURL = url; // use last registry url
-                    }
-                }
-
-                if (registryURL != null) { // registry url is available
-                    // for multi-subscription scenario, use 'zone-aware' policy by default
-                    String cluster = registryURL.getParameter(CLUSTER_KEY, ZoneAwareCluster.NAME);
-                    // The invoker wrap sequence would be: ZoneAwareClusterInvoker(StaticDirectory) -> FailoverClusterInvoker(RegistryDirectory, routing happens here) -> Invoker
-                    invoker = Cluster.getCluster(cluster, false).join(new StaticDirectory(registryURL, invokers));
-                } else { // not a registry url, must be direct invoke.
-                    String cluster = CollectionUtils.isNotEmpty(invokers)
-                            ?
-                            (invokers.get(0).getUrl() != null ? invokers.get(0).getUrl().getParameter(CLUSTER_KEY, ZoneAwareCluster.NAME) :
-                                    Cluster.DEFAULT)
-                            : Cluster.DEFAULT;
-                    invoker = Cluster.getCluster(cluster).join(new StaticDirectory(invokers));
+    /**
+     * Get URLs from the registry and aggregate them.
+     */
+    private void AggregateUrlFromRegistry(Map<String, String> referenceParameters) {

Review comment:
       done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] kylixs commented on a change in pull request #8455: 【3.0】Refactor reference config

Posted by GitBox <gi...@apache.org>.
kylixs commented on a change in pull request #8455:
URL: https://github.com/apache/dubbo/pull/8455#discussion_r686613214



##########
File path: dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java
##########
@@ -247,26 +238,69 @@ protected synchronized void init() {
             this.refresh();
         }
 
-        //init serivceMetadata
+        //init serviceMetadata
         initServiceMetadata(consumer);
         serviceMetadata.setServiceType(getServiceInterfaceClass());
         // TODO, uncomment this line once service key is unified
         serviceMetadata.setServiceKey(URL.buildKey(interfaceName, group, version));
 
+        Map<String, String> referenceParameters = appendConfig();
+
+        serviceMetadata.getAttachments().putAll(referenceParameters);
+
+        ref = createProxy(referenceParameters);
+
+        serviceMetadata.setTarget(ref);
+        serviceMetadata.addAttribute(PROXY_CLASS_REF, ref);
+
         ServiceRepository repository = ApplicationModel.getServiceRepository();
         ServiceDescriptor serviceDescriptor = repository.registerService(interfaceClass);
         repository.registerConsumer(

Review comment:
       It seems that consumer model may be fetched in creating proxy processing. 
   ```java
   ```
       public InvokerInvocationHandler(Invoker<?> handler) {
           this.invoker = handler;
           this.url = invoker.getUrl();
           String serviceKey = this.url.getServiceKey();
           this.protocolServiceKey = this.url.getProtocolServiceKey();
           if (serviceKey != null) {
               this.consumerModel = ApplicationModel.getConsumerModel(serviceKey);
           }
       }
   ```
   ![image](https://user-images.githubusercontent.com/5483385/128995823-747170b8-8687-4a4a-854c-75be07b5f7c8.png)
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] CrazyHZM commented on a change in pull request #8455: 【3.0】Refactor reference config

Posted by GitBox <gi...@apache.org>.
CrazyHZM commented on a change in pull request #8455:
URL: https://github.com/apache/dubbo/pull/8455#discussion_r686598650



##########
File path: dubbo-common/src/main/java/org/apache/dubbo/rpc/model/ConsumerModel.java
##########
@@ -64,7 +66,20 @@ public ConsumerModel(String serviceKey
         this.referenceConfig = referenceConfig;
     }
 
-    public void init(Map<String, AsyncMethodInfo> attributes) {
+
+    public void initMethodModels(List<MethodConfig> methodConfigs) {
+
+        Map<String, AsyncMethodInfo> attributes = null;
+        if (CollectionUtils.isNotEmpty(methodConfigs)) {
+            attributes = new HashMap<>(16);
+            for (MethodConfig methodConfig : methodConfigs) {
+                AsyncMethodInfo asyncMethodInfo = methodConfig.convertMethodConfig2AsyncInfo();

Review comment:
       Agree with this point of view, I revised it and reviewed it again.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] codecov-commenter edited a comment on pull request #8455: 【3.0】Refactor reference config

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #8455:
URL: https://github.com/apache/dubbo/pull/8455#issuecomment-895097422


   # [Codecov](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#8455](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7a71654) into [3.0](https://codecov.io/gh/apache/dubbo/commit/0a07eaee651a263fd05c1b173b29ed220539d4dd?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0a07eae) will **decrease** coverage by `0.37%`.
   > The diff coverage is `63.19%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo/pull/8455/graphs/tree.svg?width=650&height=150&src=pr&token=VnEIkiFQT0&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##                3.0    #8455      +/-   ##
   ============================================
   - Coverage     63.30%   62.93%   -0.38%     
     Complexity      312      312              
   ============================================
     Files          1104     1111       +7     
     Lines         46258    46486     +228     
     Branches       6977     7002      +25     
   ============================================
   - Hits          29282    29254      -28     
   - Misses        13708    13965     +257     
   + Partials       3268     3267       -1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...g/apache/dubbo/config/AbstractInterfaceConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvQWJzdHJhY3RJbnRlcmZhY2VDb25maWcuamF2YQ==) | `86.75% <0.00%> (ø)` | |
   | [...e/dubbo/registry/integration/RegistryProtocol.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9pbnRlZ3JhdGlvbi9SZWdpc3RyeVByb3RvY29sLmphdmE=) | `59.27% <ø> (ø)` | |
   | [...n/java/org/apache/dubbo/config/AbstractConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvQWJzdHJhY3RDb25maWcuamF2YQ==) | `81.03% <31.57%> (+0.41%)` | :arrow_up: |
   | [...ain/java/org/apache/dubbo/config/MethodConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvTWV0aG9kQ29uZmlnLmphdmE=) | `84.31% <65.21%> (-3.57%)` | :arrow_down: |
   | [.../java/org/apache/dubbo/config/ReferenceConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29uZmlnL2R1YmJvLWNvbmZpZy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL2NvbmZpZy9SZWZlcmVuY2VDb25maWcuamF2YQ==) | `76.07% <65.93%> (+1.07%)` | :arrow_up: |
   | [...a/org/apache/dubbo/config/ReferenceConfigBase.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvUmVmZXJlbmNlQ29uZmlnQmFzZS5qYXZh) | `69.49% <100.00%> (ø)` | |
   | [...java/org/apache/dubbo/rpc/model/ConsumerModel.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9ycGMvbW9kZWwvQ29uc3VtZXJNb2RlbC5qYXZh) | `55.38% <100.00%> (+5.38%)` | :arrow_up: |
   | [...ng/transport/dispatcher/all/AllChannelHandler.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvZGlzcGF0Y2hlci9hbGwvQWxsQ2hhbm5lbEhhbmRsZXIuamF2YQ==) | `62.06% <0.00%> (-27.59%)` | :arrow_down: |
   | [...ing/context/DubboBootstrapApplicationListener.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29uZmlnL2R1YmJvLWNvbmZpZy1zcHJpbmcvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL2NvbmZpZy9zcHJpbmcvY29udGV4dC9EdWJib0Jvb3RzdHJhcEFwcGxpY2F0aW9uTGlzdGVuZXIuamF2YQ==) | `60.00% <0.00%> (-22.00%)` | :arrow_down: |
   | [...dubbo/common/status/support/LoadStatusChecker.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb21tb24vc3RhdHVzL3N1cHBvcnQvTG9hZFN0YXR1c0NoZWNrZXIuamF2YQ==) | `46.15% <0.00%> (-15.39%)` | :arrow_down: |
   | ... and [55 more](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [0a07eae...7a71654](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] CrazyHZM commented on a change in pull request #8455: 【3.0】Refactor reference config

Posted by GitBox <gi...@apache.org>.
CrazyHZM commented on a change in pull request #8455:
URL: https://github.com/apache/dubbo/pull/8455#discussion_r686489177



##########
File path: dubbo-common/src/main/java/org/apache/dubbo/rpc/model/ConsumerModel.java
##########
@@ -64,7 +66,20 @@ public ConsumerModel(String serviceKey
         this.referenceConfig = referenceConfig;
     }
 
-    public void init(Map<String, AsyncMethodInfo> attributes) {
+
+    public void initMethodModels(List<MethodConfig> methodConfigs) {
+
+        Map<String, AsyncMethodInfo> attributes = null;
+        if (CollectionUtils.isNotEmpty(methodConfigs)) {
+            attributes = new HashMap<>(16);
+            for (MethodConfig methodConfig : methodConfigs) {
+                AsyncMethodInfo asyncMethodInfo = methodConfig.convertMethodConfig2AsyncInfo();

Review comment:
       In fact, ConsumerModel is not that simple, and the initMethodModels method of ConsumerModel is for MethodModel. There is nothing wrong with the association between MethodModel and MethodConfig.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] kylixs commented on a change in pull request #8455: 【3.0】Refactor reference config

Posted by GitBox <gi...@apache.org>.
kylixs commented on a change in pull request #8455:
URL: https://github.com/apache/dubbo/pull/8455#discussion_r687578575



##########
File path: dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java
##########
@@ -305,143 +353,153 @@ protected synchronized void init() {
                         map.put(methodConfig.getName() + ".retries", "0");
                     }
                 }
-                AsyncMethodInfo asyncMethodInfo = AbstractConfig.convertMethodConfig2AsyncInfo(methodConfig);
-                if (asyncMethodInfo != null) {
-//                    consumerModel.getMethodModel(methodConfig.getName()).addAttribute(ASYNC_KEY, asyncMethodInfo);
-                    attributes.put(methodConfig.getName(), asyncMethodInfo);
-                }
             }
         }
 
-        String hostToRegistry = ConfigUtils.getSystemProperty(DUBBO_IP_TO_REGISTRY);
-        if (StringUtils.isEmpty(hostToRegistry)) {
-            hostToRegistry = NetUtils.getLocalHost();
-        } else if (isInvalidLocalHost(hostToRegistry)) {
-            throw new IllegalArgumentException(
-                    "Specified invalid registry ip from property:" + DUBBO_IP_TO_REGISTRY + ", value:" + hostToRegistry);
-        }
-        map.put(REGISTER_IP_KEY, hostToRegistry);
+        return map;
+    }
 
-        serviceMetadata.getAttachments().putAll(map);
+    @SuppressWarnings({"unchecked"})
+    private T createProxy(Map<String, String> referenceParameters) {
+        if (shouldJvmRefer(referenceParameters)) {
+            createInvokerForLocal(referenceParameters);
+        } else {
+            urls.clear();
+            if (url != null && url.length() > 0) {
+                // user specified URL, could be peer-to-peer address, or register center's address.
+                parseUrl(referenceParameters);
+            } else {
+                // if protocols not in jvm checkRegistry
+                if (!LOCAL_PROTOCOL.equalsIgnoreCase(getProtocol())) {
+                    aggregateUrlFromRegistry(referenceParameters);
+                }
+            }
+            createInvokerForRemote();
+        }
 
-        ref = createProxy(map);
+        if (logger.isInfoEnabled()) {
+            logger.info("Referred dubbo service " + interfaceClass.getName());

Review comment:
       use unique service name is more explicit.
   ```java
   logger.info("Referred dubbo service: " + this.getUniqueServiceName());
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] CrazyHZM commented on a change in pull request #8455: 【3.0】Refactor reference config

Posted by GitBox <gi...@apache.org>.
CrazyHZM commented on a change in pull request #8455:
URL: https://github.com/apache/dubbo/pull/8455#discussion_r686627036



##########
File path: dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java
##########
@@ -247,26 +238,69 @@ protected synchronized void init() {
             this.refresh();
         }
 
-        //init serivceMetadata
+        //init serviceMetadata
         initServiceMetadata(consumer);
         serviceMetadata.setServiceType(getServiceInterfaceClass());
         // TODO, uncomment this line once service key is unified
         serviceMetadata.setServiceKey(URL.buildKey(interfaceName, group, version));
 
+        Map<String, String> referenceParameters = appendConfig();
+
+        serviceMetadata.getAttachments().putAll(referenceParameters);
+
+        ref = createProxy(referenceParameters);
+
+        serviceMetadata.setTarget(ref);
+        serviceMetadata.addAttribute(PROXY_CLASS_REF, ref);
+
         ServiceRepository repository = ApplicationModel.getServiceRepository();
         ServiceDescriptor serviceDescriptor = repository.registerService(interfaceClass);
         repository.registerConsumer(

Review comment:
       Has been adjusted, I feel that it can be optimized here.
   At that time, I will think about the process here




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ merged pull request #8455: 【3.0】Refactor reference config

Posted by GitBox <gi...@apache.org>.
AlbumenJ merged pull request #8455:
URL: https://github.com/apache/dubbo/pull/8455


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] kylixs commented on a change in pull request #8455: 【3.0】Refactor reference config

Posted by GitBox <gi...@apache.org>.
kylixs commented on a change in pull request #8455:
URL: https://github.com/apache/dubbo/pull/8455#discussion_r686549541



##########
File path: dubbo-common/src/main/java/org/apache/dubbo/rpc/model/ConsumerModel.java
##########
@@ -64,7 +66,20 @@ public ConsumerModel(String serviceKey
         this.referenceConfig = referenceConfig;
     }
 
-    public void init(Map<String, AsyncMethodInfo> attributes) {
+
+    public void initMethodModels(List<MethodConfig> methodConfigs) {
+
+        Map<String, AsyncMethodInfo> attributes = null;
+        if (CollectionUtils.isNotEmpty(methodConfigs)) {
+            attributes = new HashMap<>(16);
+            for (MethodConfig methodConfig : methodConfigs) {
+                AsyncMethodInfo asyncMethodInfo = methodConfig.convertMethodConfig2AsyncInfo();

Review comment:
       There are still some problems:
   * `ConsumerMethodModel` and `AsyncMethodInfo` are not the same things, the method naming is not very appropriate `initMethodModels(List<MethodConfig> methodConfigs)`, the origin method name is `init()`, it's means do some initialization, may include other attributes later. 
   * `List<MethodConfig> methodConfigs` can be obtained by `ReferenceConfig.getMethods()`. 
   In fact, it does not need to be passed in by parameters.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] kylixs commented on a change in pull request #8455: 【3.0】Refactor reference config

Posted by GitBox <gi...@apache.org>.
kylixs commented on a change in pull request #8455:
URL: https://github.com/apache/dubbo/pull/8455#discussion_r686613214



##########
File path: dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java
##########
@@ -247,26 +238,69 @@ protected synchronized void init() {
             this.refresh();
         }
 
-        //init serivceMetadata
+        //init serviceMetadata
         initServiceMetadata(consumer);
         serviceMetadata.setServiceType(getServiceInterfaceClass());
         // TODO, uncomment this line once service key is unified
         serviceMetadata.setServiceKey(URL.buildKey(interfaceName, group, version));
 
+        Map<String, String> referenceParameters = appendConfig();
+
+        serviceMetadata.getAttachments().putAll(referenceParameters);
+
+        ref = createProxy(referenceParameters);
+
+        serviceMetadata.setTarget(ref);
+        serviceMetadata.addAttribute(PROXY_CLASS_REF, ref);
+
         ServiceRepository repository = ApplicationModel.getServiceRepository();
         ServiceDescriptor serviceDescriptor = repository.registerService(interfaceClass);
         repository.registerConsumer(

Review comment:
       It seems that consumer model may be fetched in creating proxy processing. 
   ```java
       public InvokerInvocationHandler(Invoker<?> handler) {
           this.invoker = handler;
           this.url = invoker.getUrl();
           String serviceKey = this.url.getServiceKey();
           this.protocolServiceKey = this.url.getProtocolServiceKey();
           if (serviceKey != null) {
               this.consumerModel = ApplicationModel.getConsumerModel(serviceKey);
           }
       }
   ```
   ![image](https://user-images.githubusercontent.com/5483385/128995823-747170b8-8687-4a4a-854c-75be07b5f7c8.png)
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] codecov-commenter edited a comment on pull request #8455: 【3.0】Refactor reference config

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #8455:
URL: https://github.com/apache/dubbo/pull/8455#issuecomment-895097422


   # [Codecov](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#8455](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7a71654) into [3.0](https://codecov.io/gh/apache/dubbo/commit/0a07eaee651a263fd05c1b173b29ed220539d4dd?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0a07eae) will **decrease** coverage by `0.21%`.
   > The diff coverage is `63.19%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo/pull/8455/graphs/tree.svg?width=650&height=150&src=pr&token=VnEIkiFQT0&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##                3.0    #8455      +/-   ##
   ============================================
   - Coverage     63.30%   63.08%   -0.22%     
     Complexity      312      312              
   ============================================
     Files          1104     1111       +7     
     Lines         46258    46486     +228     
     Branches       6977     7002      +25     
   ============================================
   + Hits          29282    29328      +46     
   - Misses        13708    13899     +191     
   + Partials       3268     3259       -9     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...g/apache/dubbo/config/AbstractInterfaceConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvQWJzdHJhY3RJbnRlcmZhY2VDb25maWcuamF2YQ==) | `86.75% <0.00%> (ø)` | |
   | [...e/dubbo/registry/integration/RegistryProtocol.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9pbnRlZ3JhdGlvbi9SZWdpc3RyeVByb3RvY29sLmphdmE=) | `59.27% <ø> (ø)` | |
   | [...n/java/org/apache/dubbo/config/AbstractConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvQWJzdHJhY3RDb25maWcuamF2YQ==) | `81.03% <31.57%> (+0.41%)` | :arrow_up: |
   | [...ain/java/org/apache/dubbo/config/MethodConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvTWV0aG9kQ29uZmlnLmphdmE=) | `84.31% <65.21%> (-3.57%)` | :arrow_down: |
   | [.../java/org/apache/dubbo/config/ReferenceConfig.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29uZmlnL2R1YmJvLWNvbmZpZy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL2NvbmZpZy9SZWZlcmVuY2VDb25maWcuamF2YQ==) | `76.07% <65.93%> (+1.07%)` | :arrow_up: |
   | [...a/org/apache/dubbo/config/ReferenceConfigBase.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb25maWcvUmVmZXJlbmNlQ29uZmlnQmFzZS5qYXZh) | `69.49% <100.00%> (ø)` | |
   | [...java/org/apache/dubbo/rpc/model/ConsumerModel.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9ycGMvbW9kZWwvQ29uc3VtZXJNb2RlbC5qYXZh) | `55.38% <100.00%> (+5.38%)` | :arrow_up: |
   | [...ing/context/DubboBootstrapApplicationListener.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29uZmlnL2R1YmJvLWNvbmZpZy1zcHJpbmcvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL2NvbmZpZy9zcHJpbmcvY29udGV4dC9EdWJib0Jvb3RzdHJhcEFwcGxpY2F0aW9uTGlzdGVuZXIuamF2YQ==) | `60.00% <0.00%> (-22.00%)` | :arrow_down: |
   | [...he/dubbo/common/config/CompositeConfiguration.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb21tb24vY29uZmlnL0NvbXBvc2l0ZUNvbmZpZ3VyYXRpb24uamF2YQ==) | `46.42% <0.00%> (-14.29%)` | :arrow_down: |
   | [...ng/transport/dispatcher/all/AllChannelHandler.java](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvZGlzcGF0Y2hlci9hbGwvQWxsQ2hhbm5lbEhhbmRsZXIuamF2YQ==) | `82.75% <0.00%> (-6.90%)` | :arrow_down: |
   | ... and [35 more](https://codecov.io/gh/apache/dubbo/pull/8455/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [0a07eae...7a71654](https://codecov.io/gh/apache/dubbo/pull/8455?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org