cmccabe commented on code in PR #16774:
URL: https://github.com/apache/kafka/pull/16774#discussion_r1708454695


##########
raft/src/main/java/org/apache/kafka/raft/KafkaNetworkChannel.java:
##########
@@ -185,6 +187,10 @@ static AbstractRequest.Builder<? extends AbstractRequest> 
buildRequest(ApiMessag
             return new FetchRequest.SimpleBuilder((FetchRequestData) 
requestData);
         if (requestData instanceof FetchSnapshotRequestData)
             return new FetchSnapshotRequest.Builder((FetchSnapshotRequestData) 
requestData);
+        if (requestData instanceof ApiVersionsRequestData)
+            return new ApiVersionsRequest.Builder((ApiVersionsRequestData) 
requestData,
+                ApiKeys.API_VERSIONS.oldestVersion(),
+                ApiKeys.API_VERSIONS.latestVersion());

Review Comment:
   The reason is more mundane than that. I didn't want to have a lot of 
constructors, so I decided to have:
   
   - no-args
   - required-version
   - data, min-version, max-version
   
   I could create lots of permutations, like:
   
   - no-args 
   - required-version
   -  data
   - data, required-version
   - data, min-version, max-version
   
   but 3 constructors seems like enough?



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

Reply via email to