UpdateFeatures
This page encodes the smallest legal instance of the request and the response: numeric fields are zero, strings and byte arrays are empty, every array carries exactly one sample element, and any records field holds one empty 61-byte RecordBatch v2. Version 2 is a flexible version, so every struct is terminated by a uvarint tagged-field count and strings and arrays carry compact length-plus-one prefixes. Sizes below include the leading int32 size prefix.
- API key
- 57
- Encoded at
- v2
- Flexible versions
- 0+
- Headers
- req v2, resp v1
- Request versions
- 0-2
- Response versions
- 0-2
- Request size
- 27 bytes
- Response size
- 17 bytes
framerpc headerrequest bodyRecordBatchRecordresponse bodytagged_fields
Request
UpdateFeaturesRequest v2, request header v2, 27 bytes on the wire
byte layout (27 bytes, 16 bytes per row)
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
0000
0010
object tree
UpdateFeaturesRequest message v2 [0x0000, 27B] +-- Frame [0x0000, 4B] length-delimited framing | +-- size int32 = 23 [0x0000, 4B] number of bytes that follow, patched after encoding +-- RequestHeader v2 [0x0004, 11B] common request header | +-- request_api_key int16 = 57 (UpdateFeatures) [0x0004, 2B] numeric id of the API being invoked | +-- request_api_version int16 = 2 [0x0006, 2B] version of the API being invoked | +-- correlation_id int32 = 0 [0x0008, 4B] echoed back by the broker in the response | +-- client_id nullable_string = "" (int16 len=0) [0x000c, 2B] always a non-flexible int16-prefixed string | +-- tagged_fields uvarint = 0 [0x000e, 1B] number of tagged fields in the header +-- UpdateFeaturesRequest struct [0x000f, 12B] message body, version 2 +-- timeoutMs int32 = 0 [0x000f, 4B] How long to wait in milliseconds before timing out the request. +-- FeatureUpdates []FeatureUpdateKey = 1 element [0x0013, 6B] The list of updates to finalized features. | +-- length uvarint = 2 (compact, n+1) [0x0013, 1B] one sample element follows | +-- FeatureUpdateKey[0] FeatureUpdateKey = struct [0x0014, 5B] | +-- Feature string = "" (compact, len+1=1) [0x0014, 1B] The name of the finalized feature to be updated. | +-- MaxVersionLevel int16 = 0 [0x0015, 2B] The new maximum version level for the finalized feature. A value >= 1 is va... | +-- UpgradeType int8 = 0 [0x0017, 1B] Determine which type of upgrade will be performed: 1 will perform an upgrad... | +-- tagged_fields uvarint = 0 [0x0018, 1B] number of tagged fields in this struct +-- ValidateOnly bool = false [0x0019, 1B] True if we should validate the request, but not perform the upgrade or down... +-- tagged_fields uvarint = 0 [0x001a, 1B] number of tagged fields in this struct
kafka message schema (.json)
{ "apiKey": 57, "type": "request", "listeners": ["broker", "controller"], "name": "UpdateFeaturesRequest", // Version 1 adds validate only field. // // Version 2 changes the response to not return feature level results. "validVersions": "0-2", "flexibleVersions": "0+", "fields": [ { "name": "timeoutMs", "type": "int32", "versions": "0+", "default": "60000", "about": "How long to wait in milliseconds before timing out the request." }, { "name": "FeatureUpdates", "type": "[]FeatureUpdateKey", "versions": "0+", "about": "The list of updates to finalized features.", "fields": [ { "name": "Feature", "type": "string", "versions": "0+", "mapKey": true, "about": "The name of the finalized feature to be updated."}, { "name": "MaxVersionLevel", "type": "int16", "versions": "0+", "about": "The new maximum version level for the finalized feature. A value >= 1 is valid. A value < 1, is special, and can be used to request the deletion of the finalized feature."}, { "name": "AllowDowngrade", "type": "bool", "versions": "0", "about": "DEPRECATED in version 1 (see DowngradeType). When set to true, the finalized feature version level is allowed to be downgraded/deleted. The downgrade request will fail if the new maximum version level is a value that's not lower than the existing maximum finalized version level."}, { "name": "UpgradeType", "type": "int8", "versions": "1+", "default": 1, "about": "Determine which type of upgrade will be performed: 1 will perform an upgrade only (default), 2 is safe downgrades only (lossless), 3 is unsafe downgrades (lossy)."} ]}, { "name": "ValidateOnly", "type": "bool", "versions": "1+", "default": false, "about": "True if we should validate the request, but not perform the upgrade or downgrade."} ] }
Response
UpdateFeaturesResponse v2, response header v1, 17 bytes on the wire
byte layout (17 bytes, 16 bytes per row)
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
0000
0010
object tree
UpdateFeaturesResponse message v2 [0x0000, 17B] +-- Frame [0x0000, 4B] length-delimited framing | +-- size int32 = 13 [0x0000, 4B] number of bytes that follow, patched after encoding +-- ResponseHeader v1 [0x0004, 5B] common response header | +-- correlation_id int32 = 0 [0x0004, 4B] matches the correlation_id of the request | +-- tagged_fields uvarint = 0 [0x0008, 1B] number of tagged fields in the header +-- UpdateFeaturesResponse struct [0x0009, 8B] message body, version 2 +-- ThrottleTimeMs int32 = 0 [0x0009, 4B] The duration in milliseconds for which the request was throttled due to a q... +-- ErrorCode int16 = 0 [0x000d, 2B] The top-level error code, or `0` if there was no top-level error. +-- ErrorMessage string = "" (compact, len+1=1) [0x000f, 1B] The top-level error message, or `null` if there was no top-level error. +-- tagged_fields uvarint = 0 [0x0010, 1B] number of tagged fields in this struct
kafka message schema (.json)
{ "apiKey": 57, "type": "response", "name": "UpdateFeaturesResponse", "validVersions": "0-2", "flexibleVersions": "0+", "fields": [ { "name": "ThrottleTimeMs", "type": "int32", "versions": "0+", "about": "The duration in milliseconds for which the request was throttled due to a quota violation, or zero if the request did not violate any quota." }, { "name": "ErrorCode", "type": "int16", "versions": "0+", "about": "The top-level error code, or `0` if there was no top-level error." }, { "name": "ErrorMessage", "type": "string", "versions": "0+", "nullableVersions": "0+", "about": "The top-level error message, or `null` if there was no top-level error." }, { "name": "Results", "type": "[]UpdatableFeatureResult", "versions": "0-1", "ignorable": true, "about": "Results for each feature update.", "fields": [ { "name": "Feature", "type": "string", "versions": "0+", "mapKey": true, "about": "The name of the finalized feature."}, { "name": "ErrorCode", "type": "int16", "versions": "0+", "about": "The feature update error code or `0` if the feature update succeeded." }, { "name": "ErrorMessage", "type": "string", "versions": "0+", "nullableVersions": "0+", "about": "The feature update error, or `null` if the feature update succeeded." } ]} ] }