ChenSammi commented on code in PR #6434:
URL: https://github.com/apache/ozone/pull/6434#discussion_r1537299153
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -1155,11 +1157,15 @@ public void setScmTopologyClient(
}
public NetworkTopology getClusterMap() {
- InnerNode currentTree = scmTopologyClient.getClusterTree();
- return new NetworkTopologyImpl(configuration.get(
- ScmConfigKeys.OZONE_SCM_NETWORK_TOPOLOGY_SCHEMA_FILE,
- ScmConfigKeys.OZONE_SCM_NETWORK_TOPOLOGY_SCHEMA_FILE_DEFAULT),
- currentTree);
+ InnerNode fetchedTree = scmTopologyClient.getClusterTree();
+ if (!clusterTree.equals(fetchedTree)) {
Review Comment:
Every call of getClusterMap, the two InnerNodes will be compared, which is
not necessary for most of time. Why not just return the NetworkTopologyImpl
from scmTopologyClient, since scmTopologyClient will periodical refresh,
compare and maintain the topology tree?
--
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]