Skip to content

Commit

Permalink
add support for ApiVersions changes (KIP-584)
Browse files Browse the repository at this point in the history
KIP-584 was partially implemented a bit ago; this adds support for that.
  • Loading branch information
twmb committed Sep 22, 2020
1 parent cd499f4 commit 74c7f57
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
20 changes: 20 additions & 0 deletions generate/DEFINITIONS
Original file line number Diff line number Diff line change
Expand Up @@ -1793,6 +1793,26 @@ ApiVersionsResponse =>
// For Kafka < 2.0.0, the throttle is applied before issuing a response.
// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
ThrottleMillis: int32 // v1+
// Features supported by the broker (see KIP-584).
SupportedFeatures: [=>] // tag 0
// The name of the feature.
Name: string
// The minimum supported version for the feature.
MinVersion: int16
// The maximum supported version for the feature.
MaxVersion: int16
// The monotonically increasing epoch for the finalized features information,
// where -1 indicates an unknown epoch.
FinalizedFeaturesEpoch: int32 // tag 1
// The list of cluster-wide finalized features (only valid if
// FinalizedFeaturesEpoch is >= 0).
FinalizedFeatures: [=>] // tag 2
// The name of the feature.
Name: string
// The cluster-wide finalized max version level for the feature.
MaxVersionLevel: int16
// The cluster-wide finalized min version level for the feature.
MinVersionLevel: int16

// CreateTopicsRequest creates Kafka topics.
//
Expand Down
4 changes: 2 additions & 2 deletions generate/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (s Struct) WriteAppend(l *LineWriter) {
f.Type.WriteAppend(l)
case NullableString:
primAppend("CompactNullableString", l) // all tags are compact
case Struct:
case Array, Struct:
l.Write("sized := false")
l.Write("lenAt := len(dst)")
line := l.line
Expand Down Expand Up @@ -459,7 +459,7 @@ func (s Struct) WriteDecode(l *LineWriter) {
l.Write("}")
}

case NullableString:
case NullableString, Array:

default:
die("type %v unsupported in decode! fix this!", f.Type)
Expand Down
2 changes: 2 additions & 0 deletions pkg/kversion/kversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@ func Tip() Versions {
v[25]++ // 2 add offsets to txn
v[26]++ // 2 end txn

v[18]++ // KAFKA-10027 4f96c5b424956355339dd3216c426c1c0388fe9e KIP-584

v = append(v,
0, // 50 describe user scram creds, KAFKA-10259 e8524ccd8fca0caac79b844d87e98e9c055f76fb KIP-554
0, // 51 alter user scram creds, same
Expand Down

0 comments on commit 74c7f57

Please sign in to comment.