jolshan commented on code in PR #15968:
URL: https://github.com/apache/kafka/pull/15968#discussion_r1639071024
##########
clients/src/main/java/org/apache/kafka/clients/ApiVersions.java:
##########
@@ -34,10 +34,21 @@ public class ApiVersions {
private final Map<String, NodeApiVersions> nodeApiVersions = new
HashMap<>();
private byte maxUsableProduceMagic = RecordBatch.CURRENT_MAGIC_VALUE;
+ private short maxProduceSupportedVersion = ApiKeys.PRODUCE.latestVersion();
public synchronized void update(String nodeId, NodeApiVersions
nodeApiVersions) {
this.nodeApiVersions.put(nodeId, nodeApiVersions);
this.maxUsableProduceMagic = computeMaxUsableProduceMagic();
+ this.maxProduceSupportedVersion = computeMaxProduceSupportedVersion();
+ }
+
+ private short computeMaxProduceSupportedVersion() {
+ Optional<Short> knownBrokerNodesMinSupportedVersionForProduce =
this.nodeApiVersions.values().stream()
Review Comment:
sounds good. this is consistent with the fetching logic 👍
--
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]