funky-eyes commented on code in PR #7882:
URL: https://github.com/apache/incubator-seata/pull/7882#discussion_r2638397460
##########
namingserver/src/main/java/org/apache/seata/namingserver/metrics/NamingServerMetricsManager.java:
##########
Review Comment:
I believe we should abstract an interface for **MetricsManager** and provide
a no-op (empty) implementation. When the Prometheus metrics feature is
disabled, we can use this empty implementation, thereby avoiding the need for
null checks in other classes that depend on MetricsManager.
##########
namingserver/src/main/java/org/apache/seata/namingserver/manager/NamingManager.java:
##########
@@ -320,12 +329,9 @@ public boolean registerInstance(NamingServerNode node,
String namespace, String
clusterName, (String)
node.getMetadata().get("cluster-type")));
boolean hasChanged = clusterData.registerInstance(node, unitName);
Object mappingObj = node.getMetadata().get(CONSTANT_GROUP);
- // if extended metadata includes vgroup mapping relationship, add
it in clusterData
if (mappingObj instanceof Map) {
Map<String, String> vGroups = (Map<String, String>) mappingObj;
vGroups.forEach((k, v) -> {
- // In non-raft mode, a unit is one-to-one with a node, and
the unitName is stored on the node.
Review Comment:
Why remove these commented-out content?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]