From e7b9d3c915e9e6744d1e32c166528e7e2ca67210 Mon Sep 17 00:00:00 2001 From: Travis Bischel Date: Thu, 10 Oct 2024 20:26:05 -0600 Subject: [PATCH] kip-994 proto Only ListTransactions was modified in 3.8 --- generate/definitions/66_list_transactions | 6 +++++- pkg/kmsg/generated.go | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/generate/definitions/66_list_transactions b/generate/definitions/66_list_transactions index 216ac02c..bf04ac93 100644 --- a/generate/definitions/66_list_transactions +++ b/generate/definitions/66_list_transactions @@ -8,8 +8,12 @@ ListTransactionsRequest => key 66, max version 0, flexible v0+ StateFilters: [string] // The producer IDs to filter by: if empty, all transactions will be // returned; if non-empty, only transactions which match one of the filtered - // producer IDs will be returned + // producer IDs will be returned. ProducerIDFilters: [int64] + // Duration (in millis) to filter by: if < 0, all transactions will be + // returned; otherwise, only transactions running longer than this duration + // will be returned. + DurationFilterMillis: int64(-1) // v1+ // ListTransactionsResponse is a response to a ListTransactionsRequest. ListTransactionsResponse => diff --git a/pkg/kmsg/generated.go b/pkg/kmsg/generated.go index 70ec0b00..16350a4a 100644 --- a/pkg/kmsg/generated.go +++ b/pkg/kmsg/generated.go @@ -43955,9 +43955,16 @@ type ListTransactionsRequest struct { // The producer IDs to filter by: if empty, all transactions will be // returned; if non-empty, only transactions which match one of the filtered - // producer IDs will be returned + // producer IDs will be returned. ProducerIDFilters []int64 + // Duration (in millis) to filter by: if < 0, all transactions will be + // returned; otherwise, only transactions running longer than this duration + // will be returned. + // + // This field has a default of -1. + DurationFilterMillis int64 // v1+ + // UnknownTags are tags Kafka sent that we do not know the purpose of. UnknownTags Tags } @@ -44015,6 +44022,10 @@ func (v *ListTransactionsRequest) AppendTo(dst []byte) []byte { dst = kbin.AppendInt64(dst, v) } } + if version >= 1 { + v := v.DurationFilterMillis + dst = kbin.AppendInt64(dst, v) + } if isFlexible { dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len())) dst = v.UnknownTags.AppendEach(dst) @@ -44097,6 +44108,10 @@ func (v *ListTransactionsRequest) readFrom(src []byte, unsafe bool) error { v = a s.ProducerIDFilters = v } + if version >= 1 { + v := b.Int64() + s.DurationFilterMillis = v + } if isFlexible { s.UnknownTags = internalReadTags(&b) } @@ -44114,6 +44129,7 @@ func NewPtrListTransactionsRequest() *ListTransactionsRequest { // Default sets any default fields. Calling this allows for future compatibility // if new fields are added to ListTransactionsRequest. func (v *ListTransactionsRequest) Default() { + v.DurationFilterMillis = -1 } // NewListTransactionsRequest returns a default ListTransactionsRequest