kevin-wu24 commented on code in PR #19668:
URL: https://github.com/apache/kafka/pull/19668#discussion_r2114485386
##########
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:
We can, but I'm not sure what that really changes. Instead of having the
lambda in the `maybeSend*` methods, we'll just have it in the `build.*Request`
implementation. Am I missing something? We don't want to actually create the
`requestData` until we enter `maybeSendRequest`, so we'll need a lambda
somewhere no?
--
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]