smjn commented on code in PR #17656:
URL: https://github.com/apache/kafka/pull/17656#discussion_r1825811418


##########
share-coordinator/src/main/java/org/apache/kafka/coordinator/share/ShareCoordinatorService.java:
##########
@@ -539,7 +539,7 @@ public void onNewMetadataImage(MetadataImage newImage, 
MetadataDelta delta) {
     }
 
     private TopicPartition topicPartitionFor(SharePartitionKey key) {
-        return new TopicPartition(Topic.SHARE_GROUP_STATE_TOPIC_NAME, 
partitionFor(key.toString()));
+        return new TopicPartition(Topic.SHARE_GROUP_STATE_TOPIC_NAME, 
partitionFor(key.asCoordinatorKey()));

Review Comment:
   @AndrewJSchofield 
   > We could transform that into a SharePartitionKey on receipt
   Which would mean writing code to split and format strings - was trying to 
avoid it.
   
   > is a combination of a group ID and a TopicIdPartition
   I did not want to do this. The initial impl of SPK clearly defined 3 fields 
-String groupId, Uuid topicId, int partition. In fact, the entire 
share-coordinator flow does not use the TopicIdPartition argument to the 
constructor at all. Not sure whether it is necessary for the SharePartition 
flow or was it done for aesthetic reasons.



##########
share-coordinator/src/main/java/org/apache/kafka/coordinator/share/ShareCoordinatorService.java:
##########
@@ -539,7 +539,7 @@ public void onNewMetadataImage(MetadataImage newImage, 
MetadataDelta delta) {
     }
 
     private TopicPartition topicPartitionFor(SharePartitionKey key) {
-        return new TopicPartition(Topic.SHARE_GROUP_STATE_TOPIC_NAME, 
partitionFor(key.toString()));
+        return new TopicPartition(Topic.SHARE_GROUP_STATE_TOPIC_NAME, 
partitionFor(key.asCoordinatorKey()));

Review Comment:
   @AndrewJSchofield 
   > We could transform that into a SharePartitionKey on receipt
   
   Which would mean writing code to split and format strings - was trying to 
avoid it.
   
   > is a combination of a group ID and a TopicIdPartition
   
   I did not want to do this. The initial impl of SPK clearly defined 3 fields 
-String groupId, Uuid topicId, int partition. In fact, the entire 
share-coordinator flow does not use the TopicIdPartition argument to the 
constructor at all. Not sure whether it is necessary for the SharePartition 
flow or was it done for aesthetic reasons.



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