jsancio commented on code in PR #19668:
URL: https://github.com/apache/kafka/pull/19668#discussion_r2102777984
##########
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java:
##########
@@ -3771,6 +3763,24 @@ private boolean isInitialized() {
return partitionState != null && quorum != null && requestManager !=
null && kafkaRaftMetrics != null;
}
+ private record RequestSupplier(Supplier<ApiMessage> supplier, ApiKeys
apiKey) {
Review Comment:
Let's move this type to `o.a.k.r.internals`. This file is already long
enough.
I don't think it is idiomatic to use `record` in this case since
`Supplier<ApiMessage>` is a lambda and not a simple data type. From the Java's
documentation:
> Record classes, which are a special kind of class, help to model plain
data aggregates with less ceremony than normal classes.
>
> For background information about record classes, see [JEP
395](https://openjdk.java.net/jeps/395).
>
> A record declaration specifies in a header a description of its contents;
the appropriate accessors, constructor, equals, hashCode, and toString methods
are created automatically. A record's fields are final because the class is
intended to serve as a simple "data carrier".
--
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]