Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize: optimize the initialization logic for server meta #6795

Merged
merged 44 commits into from
Sep 2, 2024

Conversation

ggbocoder
Copy link
Contributor

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

1.optimize the initialization logic for server meta
2.use jackson to serialize node
3.remove the logic of replacing node-weight using metadata

Ⅱ. 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

# Conflicts:
#	changes/en-us/2.x.md
#	changes/zh-cn/2.x.md
# Conflicts:
#	changes/zh-cn/2.x.md
…mingserver

# Conflicts:
#	namingserver/src/main/java/org/apache/seata/namingserver/manager/NamingManager.java
…mingserver

# Conflicts:
#	changes/en-us/2.x.md
#	changes/zh-cn/2.x.md
…mingserver

# Conflicts:
#	namingserver/src/main/java/org/apache/seata/namingserver/manager/NamingManager.java
ggbocoder and others added 8 commits August 24, 2024 22:37
…mingserver

# Conflicts:
#	changes/en-us/2.x.md
#	changes/zh-cn/2.x.md
#	namingserver/src/main/java/org/apache/seata/namingserver/manager/NamingManager.java
#	script/server/db/mysql.sql
@funky-eyes funky-eyes changed the title Optimize: optimize the initialization logic for server meta optimize: optimize the initialization logic for server meta Aug 29, 2024
}

@Resource
ServerInstance serverInstance;
Copy link
Contributor

Choose a reason for hiding this comment

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

registryNamingServerProperties 和 registryProperties在server里就不需要了吧?
registryNamingServerProperties and registryProperties are not needed in the server, right?

Copy link

codecov bot commented Aug 30, 2024

Codecov Report

Attention: Patch coverage is 17.94872% with 32 lines in your changes missing coverage. Please review.

Project coverage is 52.49%. Comparing base (1d426ed) to head (9a09fd7).
Report is 1 commits behind head on 2.x.

Files with missing lines Patch % Lines
...g/apache/seata/server/instance/ServerInstance.java 12.50% 27 Missing and 1 partial ⚠️
...in/java/org/apache/seata/common/metadata/Node.java 33.33% 2 Missing ⚠️
.../namingserver/NamingserverRegistryServiceImpl.java 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #6795      +/-   ##
============================================
+ Coverage     52.30%   52.49%   +0.18%     
- Complexity     6373     6390      +17     
============================================
  Files          1078     1079       +1     
  Lines         37483    37462      -21     
  Branches       4440     4435       -5     
============================================
+ Hits          19607    19665      +58     
+ Misses        15940    15856      -84     
- Partials       1936     1941       +5     
Files with missing lines Coverage Δ
...e/seata/common/metadata/namingserver/Instance.java 41.79% <ø> (-0.86%) ⬇️
...common/metadata/namingserver/NamingServerNode.java 34.61% <ø> (-2.06%) ⬇️
...he/seata/namingserver/entity/pojo/ClusterData.java 70.90% <ø> (+3.11%) ⬆️
...ache/seata/namingserver/manager/NamingManager.java 68.89% <100.00%> (+0.47%) ⬆️
.../src/main/java/org/apache/seata/server/Server.java 72.72% <100.00%> (+31.45%) ⬆️
...in/java/org/apache/seata/common/metadata/Node.java 62.50% <33.33%> (+12.50%) ⬆️
.../namingserver/NamingserverRegistryServiceImpl.java 0.00% <0.00%> (ø)
...g/apache/seata/server/instance/ServerInstance.java 12.50% <12.50%> (ø)

... and 9 files with indirect coverage changes

@@ -40,6 +43,8 @@ public class Node {

private Map<String, Object> metadata = new HashMap<>();

private ObjectMapper objectMapper = new ObjectMapper();
Copy link
Contributor

Choose a reason for hiding this comment

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

不要在node里创建这东西

@@ -41,7 +41,7 @@ public class Instance {
private long timestamp;
private ClusterRole role = ClusterRole.MEMBER;
private Map<String, Object> metadata = new HashMap<>();

private final ObjectMapper objectMapper = new ObjectMapper();
Copy link
Contributor

Choose a reason for hiding this comment

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

不要在这个里面构建ObjectMapper

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

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

LGTM

@funky-eyes funky-eyes merged commit 77c81d5 into apache:2.x Sep 2, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants