Skip to content

Commit

Permalink
k/protocol/generator: Use read_array<container>
Browse files Browse the repository at this point in the history
Construct a large_fragment_vector during read_array for types
listed in `enable_fragmentation_resistance`, which is currently
`metadata_response_partition`.

Signed-off-by: Ben Pope <[email protected]>
  • Loading branch information
BenPope committed Oct 2, 2023
1 parent e2f4c4e commit b20a486
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/v/kafka/protocol/schemata/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,8 @@ class response;
{%- if field.is_array %}
{%- set nullable = "nullable_" if field.nullable() else "" %}
{%- set flex = "flex_" if flex else "" %}
{{ fname }} = reader.read_{{nullable}}{{flex}}array([version](protocol::decoder& reader) {
{%- set container = (field.type_name_parts() | list)[1] %}
{{ fname }} = reader.read_{{nullable}}{{flex}}array<{{ container }}>([version](protocol::decoder& reader) {
(void)version;
{%- if field.type().value_type().is_struct %}
{{ field.type().value_type().name }} v;
Expand Down

0 comments on commit b20a486

Please sign in to comment.