jeffkbkim commented on code in PR #13231:
URL: https://github.com/apache/kafka/pull/13231#discussion_r1107838433


##########
clients/src/main/java/org/apache/kafka/common/requests/AddPartitionsToTxnRequest.java:
##########
@@ -35,21 +44,43 @@ public class AddPartitionsToTxnRequest extends 
AbstractRequest {
     private final AddPartitionsToTxnRequestData data;
 
     private List<TopicPartition> cachedPartitions = null;
+    
+    private Map<String, List<TopicPartition>> cachedPartitionsByTransaction = 
null;
+
+    private final short version;
 
     public static class Builder extends 
AbstractRequest.Builder<AddPartitionsToTxnRequest> {
         public final AddPartitionsToTxnRequestData data;
+        public final boolean isClientRequest;
 
-        public Builder(final AddPartitionsToTxnRequestData data) {
+        // Only used for versions < 4
+        public Builder(String transactionalId,
+                       long producerId,
+                       short producerEpoch,
+                       List<TopicPartition> partitions) {
             super(ApiKeys.ADD_PARTITIONS_TO_TXN);
-            this.data = data;
+            this.isClientRequest = true;
+
+            AddPartitionsToTxnTopicCollection topics = 
compileTopics(partitions);
+
+            this.data = new AddPartitionsToTxnRequestData()
+                    .setTransactionalId(transactionalId)
+                    .setProducerId(producerId)
+                    .setProducerEpoch(producerEpoch)
+                    .setTopics(topics);

Review Comment:
   i don't know either 😅 i only bring this up because i had feedback on this 
before. it seems like other places use both double indentation and single so 
maybe we should have a formalized decision



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

Reply via email to