jsancio commented on code in PR #19668:
URL: https://github.com/apache/kafka/pull/19668#discussion_r2116144053


##########
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java:
##########
@@ -3301,20 +3313,23 @@ private long maybeSendFetchToBestNode(FollowerState 
state, long currentTimeMs) {
 
     private long maybeSendFetchOrFetchSnapshot(FollowerState state, long 
currentTimeMs) {
         final Supplier<ApiMessage> requestSupplier;
+        final ApiKeys requestType;
 
         if (state.fetchingSnapshot().isPresent()) {
             RawSnapshotWriter snapshot = state.fetchingSnapshot().get();
             long snapshotSize = snapshot.sizeInBytes();
 
             requestSupplier = () -> 
buildFetchSnapshotRequest(snapshot.snapshotId(), snapshotSize);
+            requestType = ApiKeys.FETCH_SNAPSHOT;

Review Comment:
   What I observe is that code tends to have 
`RequestSupplier.of(this::build.*Request, ApiKeys.X)`. This `X` is couple to 
the `build.*Request` so why not move that coupling to a method?



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