mimaison commented on code in PR #21471:
URL: https://github.com/apache/kafka/pull/21471#discussion_r2803527709
##########
server-common/src/main/java/org/apache/kafka/server/share/SharePartitionKey.java:
##########
@@ -88,31 +88,49 @@ public static SharePartitionKey getInstance(String key) {
* @throws IllegalArgumentException if the key is empty or has invalid
format
*/
public static void validate(String key) {
+ parseKey(key);
+ }
+
+ /**
+ * Parses a key string of format groupId:topicId:partition from the right.
+ * Since topicId and partition have fixed formats but groupId may contain
colons,
+ * parsing from the right correctly handles all valid group IDs.
+ *
+ * @return a 3-element array: [groupId, topicId, partition]
+ */
+ private static String[] parseKey(String key) {
Review Comment:
Do we save much by not combining this and `getInstance()`?
--
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]