FrankYang0529 commented on code in PR #19796: URL: https://github.com/apache/kafka/pull/19796#discussion_r2117873679
########## group-coordinator/src/test/java/org/apache/kafka/coordinator/group/modern/share/ShareGroupBuilder.java: ########## @@ -72,29 +70,8 @@ public List<CoordinatorRecord> build(TopicsImage topicsImage) { records.add(GroupCoordinatorRecordHelpers.newShareGroupMemberSubscriptionRecord(groupId, member)) ); - // Add subscription metadata. - if (subscriptionMetadata == null) { - subscriptionMetadata = new HashMap<>(); - members.forEach((memberId, member) -> - member.subscribedTopicNames().forEach(topicName -> { - TopicImage topicImage = topicsImage.getTopic(topicName); - if (topicImage != null) { - subscriptionMetadata.put(topicName, new TopicMetadata( - topicImage.id(), - topicImage.name(), - topicImage.partitions().size() - )); - } - }) - ); - } - - if (!subscriptionMetadata.isEmpty()) { - records.add(GroupCoordinatorRecordHelpers.newShareGroupSubscriptionMetadataRecord(groupId, subscriptionMetadata)); - } - // Add group epoch record. - records.add(GroupCoordinatorRecordHelpers.newShareGroupEpochRecord(groupId, groupEpoch, 0)); + records.add(GroupCoordinatorRecordHelpers.newShareGroupEpochRecord(groupId, groupEpoch, metadataHash)); Review Comment: Thanks for the suggestion. The `subscriptionMetadata` can be null, so we can determine whether a developer sets the value. However, the `metadataHash` is long and cannot be null. I would prefer to let the developer to set it manually. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org