dajac commented on code in PR #19461:
URL: https://github.com/apache/kafka/pull/19461#discussion_r2047358176


##########
clients/src/main/java/org/apache/kafka/common/requests/OffsetCommitRequest.java:
##########
@@ -45,20 +45,24 @@ public static class Builder extends 
AbstractRequest.Builder<OffsetCommitRequest>
 
         private final OffsetCommitRequestData data;
 
-        public Builder(OffsetCommitRequestData data, boolean 
enableUnstableLastVersion) {
-            super(ApiKeys.OFFSET_COMMIT, enableUnstableLastVersion);
+        private Builder(OffsetCommitRequestData data, short 
oldestAllowedVersion, short latestAllowedVersion) {
+            super(ApiKeys.OFFSET_COMMIT, oldestAllowedVersion, 
latestAllowedVersion);
             this.data = data;
         }
 
-        public Builder(OffsetCommitRequestData data) {
-            this(data, false);
+        public static Builder forTopicIdsAndNames(OffsetCommitRequestData 
data, boolean enableUnstableLastVersion) {

Review Comment:
   It depends on how you look at it. I use `forTopicIdsAndNames` because the 
`OffsetCommitRequestData` must contain both here. Topic ids or names are used 
based on the negotiated version with the broker. This is only known when the 
`build(version)` method is called.
   
   I wonder if we should actually verify that they are both provided when the 
builder is constructed. What do you think?



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