-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
optimize: optimize the initialization logic for server meta #6795
Conversation
# 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
…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
…into optimize/optimize_namingserver
common/src/main/java/org/apache/seata/common/metadata/Node.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
@Resource | ||
ServerInstance serverInstance; |
There was a problem hiding this comment.
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?
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ 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
|
@@ -40,6 +43,8 @@ public class Node { | |||
|
|||
private Map<String, Object> metadata = new HashMap<>(); | |||
|
|||
private ObjectMapper objectMapper = new ObjectMapper(); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要在这个里面构建ObjectMapper
…mingserver # Conflicts: # changes/en-us/2.x.md # changes/zh-cn/2.x.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ⅰ. 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