Phillippko commented on code in PR #7969:
URL: https://github.com/apache/ignite-3/pull/7969#discussion_r3072263109


##########
modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/segstore/SegmentLogStorageManager.java:
##########
@@ -108,21 +111,25 @@ public CompletableFuture<Void> stopAsync(ComponentContext 
componentContext) {
         }
     }
 
-    private static long convertGroupId(String groupId) {
-        if ("metastorage_group".equals(groupId)) {
-            return 1;
+    private static long convertNodeId(String nodeId) {
+        // Temporary approach, will be revised after changing partition ID 
from int to long.
+
+        StoredRaftNodeId raftNodeId = 
RaftNodeId.fromNodeIdStringForStorage(nodeId, "");
+        if ("metastorage_group".equals(raftNodeId.groupIdName())) {
+            return 1 + raftNodeId.peer().idx();
         }
 
-        if ("cmg_group".equals(groupId)) {
-            return 2;
+        if (nodeId.contains("cmg_group")) {
+            return raftNodeId.peer().idx() + 1000;
         }
 
-        String[] partitionGroupIdArray = 
PARTITION_GROUP_ID_PATTERN.split(groupId);
+        String[] partitionGroupIdArray = 
PARTITION_GROUP_ID_PATTERN.split(raftNodeId.groupIdName());
 
         if (partitionGroupIdArray.length == 2) {

Review Comment:
   refactored, moved magic numbers to constants



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

Reply via email to