Phillippko commented on code in PR #7969:
URL: https://github.com/apache/ignite-3/pull/7969#discussion_r3072172045
##########
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) {
- return Long.parseLong(partitionGroupIdArray[0]) << 32 |
Long.parseLong(partitionGroupIdArray[1]);
+ return (parseLong(partitionGroupIdArray[0]) << 32 |
parseLong(partitionGroupIdArray[1])) + 100000 + raftNodeId.peer().idx();
} else {
- throw new IllegalArgumentException("Invalid groupId: " + groupId);
+ // For tests using invalid group IDs.
Review Comment:
Discussed, added TODO as it requires changing unknown number of tests
--
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]