Shekharrajak commented on code in PR #22357:
URL: https://github.com/apache/kafka/pull/22357#discussion_r3293913659
##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:
##########
@@ -1977,6 +2026,184 @@ public void handleResponse(AbstractResponse response) {
}
}
+ private TxnShareAcknowledgeHandler txnShareAcknowledgeHandler(
+ TransactionalRequestResult result,
+ Map<TopicIdPartition, List<AcknowledgementBatch>> acknowledgements,
+ ShareGroupMetadata groupMetadata) {
+ pendingTxnShareAcks.putAll(acknowledgements);
+
+ List<TxnShareAcknowledgeTopic> topics = new ArrayList<>();
+ Map<String, TxnShareAcknowledgeTopic> topicMap = new HashMap<>();
+
+ for (Map.Entry<TopicIdPartition, List<AcknowledgementBatch>> entry :
acknowledgements.entrySet()) {
+ TopicIdPartition tip = entry.getKey();
+ String topicId = tip.topicId().toString();
+
+ TxnShareAcknowledgeTopic topic = topicMap.computeIfAbsent(topicId,
k -> {
+ TxnShareAcknowledgeTopic t = new
TxnShareAcknowledgeTopic().setTopicId(tip.topicId());
+ topics.add(t);
+ return t;
+ });
+
+ List<TxnShareAcknowledgeBatch> batches = new ArrayList<>();
+ for (AcknowledgementBatch b : entry.getValue()) {
+ for (byte ackType : b.acknowledgeTypes()) {
+ batches.add(new TxnShareAcknowledgeBatch()
+ .setFirstOffset(b.firstOffset())
Review Comment:
(firstOffset, lastOffset, ackType) triples -> this will help in pointing
to records which is already on the broker's log.
--
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]