apoorvmittal10 commented on code in PR #17796:
URL: https://github.com/apache/kafka/pull/17796#discussion_r1866757013
##########
core/src/main/java/kafka/server/share/SharePartitionManager.java:
##########
@@ -609,6 +610,12 @@ private SharePartition
getOrCreateSharePartition(SharePartitionKey sharePartitio
k -> {
long start = time.hiResClockMs();
int leaderEpoch =
ShareFetchUtils.leaderEpoch(replicaManager,
sharePartitionKey.topicIdPartition().topicPartition());
+ // Attach listener to Partition which shall invoke
partition change handlers.
+ // However, as there could be multiple share partitions
(per group name) for a single topic-partition,
+ // hence create separate listeners per share partition
which holds the share partition key
+ // to identify the respective share partition.
+
replicaManager.maybeAddListener(sharePartitionKey.topicIdPartition().topicPartition(),
Review Comment:
Valid point, I have attached a removListener method on cleanup. Done.
--
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]