@@ -34,15 +34,15 @@ public class ApiVersions {
34
34
35
35
private final Map <String , NodeApiVersions > nodeApiVersions = new HashMap <>();
36
36
private byte maxUsableProduceMagic = RecordBatch .CURRENT_MAGIC_VALUE ;
37
- private short maxProduceSupportedVersion = ApiKeys .PRODUCE .latestVersion ();
37
+ private short maxSupportedProduceVersion = ApiKeys .PRODUCE .latestVersion ();
38
38
39
39
public synchronized void update (String nodeId , NodeApiVersions nodeApiVersions ) {
40
40
this .nodeApiVersions .put (nodeId , nodeApiVersions );
41
41
this .maxUsableProduceMagic = computeMaxUsableProduceMagic ();
42
- this .maxProduceSupportedVersion = computeMaxProduceSupportedVersion ();
42
+ this .maxSupportedProduceVersion = computeMaxSupportedProduceVersion ();
43
43
}
44
44
45
- private short computeMaxProduceSupportedVersion () {
45
+ private short computeMaxSupportedProduceVersion () {
46
46
Optional <Short > knownBrokerNodesMinSupportedVersionForProduce = this .nodeApiVersions .values ().stream ()
47
47
.filter (versions -> versions .apiVersion (ApiKeys .PRODUCE ) != null ) // filter out Raft controller nodes
48
48
.map (versions -> versions .latestUsableVersion (ApiKeys .PRODUCE ))
@@ -54,6 +54,7 @@ private short computeMaxProduceSupportedVersion() {
54
54
public synchronized void remove (String nodeId ) {
55
55
this .nodeApiVersions .remove (nodeId );
56
56
this .maxUsableProduceMagic = computeMaxUsableProduceMagic ();
57
+ this .maxSupportedProduceVersion = computeMaxSupportedProduceVersion ();
57
58
}
58
59
59
60
public synchronized NodeApiVersions get (String nodeId ) {
@@ -74,8 +75,8 @@ private byte computeMaxUsableProduceMagic() {
74
75
public synchronized byte maxUsableProduceMagic () {
75
76
return maxUsableProduceMagic ;
76
77
}
77
- public synchronized short getMaxSupportedProduceVersion () {
78
- return maxProduceSupportedVersion ;
78
+ public synchronized short maxSupportedProduceVersion () {
79
+ return maxSupportedProduceVersion ;
79
80
}
80
81
81
82
}
0 commit comments