bshashikant commented on a change in pull request #1916:
URL: https://github.com/apache/ozone/pull/1916#discussion_r573998847



##########
File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMRatisServerImpl.java
##########
@@ -227,12 +240,62 @@ public RaftPeerId getPeerId() {
               "localHost: {}, OZONE_SCM_NAMES: {}, selfPeerId: {}",
           localHost, conf.get(ScmConfigKeys.OZONE_SCM_NAMES), selfPeerId);
 
-      raftGroupId = RaftGroupId.valueOf(UUID.nameUUIDFromBytes(
-          SCM_SERVICE_ID.getBytes(StandardCharsets.UTF_8)));
+      String groupId = clusterId == null ? SCM_SERVICE_ID : clusterId;
+      raftGroupId = RaftGroupId.valueOf(
+          UUID.nameUUIDFromBytes(groupId.getBytes(StandardCharsets.UTF_8)));
 
       raftGroup = RaftGroup.valueOf(raftGroupId, raftPeers);
     }
 
+    SCMHAGroupBuilder(final SCMHANodeDetails details, final String clusterId) {
+
+      Preconditions.checkNotNull(clusterId);
+      // RaftGroupId is the clusterId
+      raftGroupId = RaftGroupId.valueOf(buildRaftGroupId(clusterId));
+      final String scmNodeId = details.getLocalNodeDetails().getNodeId();
+      Preconditions.checkNotNull(scmNodeId);
+      selfPeerId = RaftPeerId.getRaftPeerId(scmNodeId);
+      Preconditions.checkNotNull(scmNodeId);

Review comment:
       Addressed




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

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to