jsancio commented on code in PR #22505:
URL: https://github.com/apache/kafka/pull/22505#discussion_r3437552799
##########
raft/src/testFixtures/java/org/apache/kafka/raft/MockNetworkChannel.java:
##########
@@ -80,10 +88,15 @@ public boolean hasSentRequests() {
}
public void mockReceive(RaftResponse.Inbound response) {
- RaftRequest.Outbound request =
awaitingResponse.get(response.correlationId());
- if (request == null) {
+ var future = awaitingResponse.get(response.correlationId());
+ if (future == null) {
throw new IllegalStateException("Received response for a request
which is not being awaited");
}
- request.completion.complete(response);
+ future.complete(response);
}
+
+ private static record RequestEntry(
Review Comment:
Yep. record are implicitly static. It is interesting that javac allows it.
Looks like checkstyle has support for this. I'll add it in another PR. Fixed
this particular issue.
##########
raft/src/test/java/org/apache/kafka/raft/KafkaRaftClientTest.java:
##########
@@ -3714,7 +3714,7 @@ public void testLeaderGracefulShutdownTimeout(boolean
withKip853Rpc) throws Exce
// Now shutdown
int shutdownTimeoutMs = 5000;
- CompletableFuture<Void> shutdownFuture =
context.client.shutdown(shutdownTimeoutMs);
+ CompletableFuture<Void> shutdownFuture =
context.client.shutdown(shutdownTimeoutMs).toCompletableFuture();
Review Comment:
Done.
--
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]