apache / incubator-seata

:fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution.
https://seata.apache.org/
Apache License 2.0
25.25k stars 8.77k forks source link

optimize: the namingserver code to improve readability #6761

Closed funky-eyes closed 1 month ago

funky-eyes commented 1 month ago

Ⅰ. Describe what this PR did

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 65.57377% with 21 lines in your changes missing coverage. Please review.

Project coverage is 50.57%. Comparing base (f7c3866) to head (4f78013). Report is 1 commits behind head on 2.x.

Files Patch % Lines
...ache/seata/namingserver/manager/NamingManager.java 61.76% 9 Missing and 4 partials :warning:
...apache/seata/namingserver/entity/bo/ClusterBO.java 61.53% 5 Missing :warning:
...ache/seata/namingserver/entity/bo/NamespaceBO.java 78.57% 2 Missing and 1 partial :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/apache/incubator-seata/pull/6761/graphs/tree.svg?width=650&height=150&src=pr&token=tbmHt2ZfxO&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/incubator-seata/pull/6761?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) ```diff @@ Coverage Diff @@ ## 2.x #6761 +/- ## ============================================ - Coverage 50.57% 50.57% -0.01% - Complexity 5936 5942 +6 ============================================ Files 1061 1063 +2 Lines 37123 37143 +20 Branches 4404 4405 +1 ============================================ + Hits 18776 18785 +9 - Misses 16445 16453 +8 - Partials 1902 1905 +3 ``` | [Files](https://app.codecov.io/gh/apache/incubator-seata/pull/6761?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [...java/org/apache/seata/common/metadata/Cluster.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6761?src=pr&el=tree&filepath=common%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fcommon%2Fmetadata%2FCluster.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9jb21tb24vbWV0YWRhdGEvQ2x1c3Rlci5qYXZh) | `0.00% <ø> (ø)` | | | [...ache/seata/namingserver/entity/bo/NamespaceBO.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6761?src=pr&el=tree&filepath=namingserver%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fnamingserver%2Fentity%2Fbo%2FNamespaceBO.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bmFtaW5nc2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9uYW1pbmdzZXJ2ZXIvZW50aXR5L2JvL05hbWVzcGFjZUJPLmphdmE=) | `78.57% <78.57%> (ø)` | | | [...apache/seata/namingserver/entity/bo/ClusterBO.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6761?src=pr&el=tree&filepath=namingserver%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fnamingserver%2Fentity%2Fbo%2FClusterBO.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bmFtaW5nc2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9uYW1pbmdzZXJ2ZXIvZW50aXR5L2JvL0NsdXN0ZXJCTy5qYXZh) | `61.53% <61.53%> (ø)` | | | [...ache/seata/namingserver/manager/NamingManager.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6761?src=pr&el=tree&filepath=namingserver%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fnamingserver%2Fmanager%2FNamingManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bmFtaW5nc2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9uYW1pbmdzZXJ2ZXIvbWFuYWdlci9OYW1pbmdNYW5hZ2VyLmphdmE=) | `67.00% <61.76%> (-0.15%)` | :arrow_down: | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/apache/incubator-seata/pull/6761/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)