Browse Source

fmt

pull/7231/head
chrislu 2 months ago
parent
commit
baed1e156a
  1. 2
      test/kafka/metadata_debug_test.go
  2. 30
      weed/mq/kafka/protocol/offset_management.go

2
test/kafka/metadata_debug_test.go

@ -5,8 +5,8 @@ import (
"testing" "testing"
"time" "time"
"github.com/segmentio/kafka-go"
"github.com/seaweedfs/seaweedfs/weed/mq/kafka/gateway" "github.com/seaweedfs/seaweedfs/weed/mq/kafka/gateway"
"github.com/segmentio/kafka-go"
) )
func TestMetadataV6Debug(t *testing.T) { func TestMetadataV6Debug(t *testing.T) {

30
weed/mq/kafka/protocol/offset_management.go

@ -13,12 +13,12 @@ import (
// OffsetCommitRequest represents an OffsetCommit request from a Kafka client // OffsetCommitRequest represents an OffsetCommit request from a Kafka client
type OffsetCommitRequest struct { type OffsetCommitRequest struct {
GroupID string
GenerationID int32
MemberID string
GroupInstanceID string // Optional static membership ID
RetentionTime int64 // Offset retention time (-1 for broker default)
Topics []OffsetCommitTopic
GroupID string
GenerationID int32
MemberID string
GroupInstanceID string // Optional static membership ID
RetentionTime int64 // Offset retention time (-1 for broker default)
Topics []OffsetCommitTopic
} }
// OffsetCommitTopic represents topic-level offset commit data // OffsetCommitTopic represents topic-level offset commit data
@ -29,10 +29,10 @@ type OffsetCommitTopic struct {
// OffsetCommitPartition represents partition-level offset commit data // OffsetCommitPartition represents partition-level offset commit data
type OffsetCommitPartition struct { type OffsetCommitPartition struct {
Index int32 // Partition index
Offset int64 // Offset to commit
LeaderEpoch int32 // Leader epoch (-1 if not available)
Metadata string // Optional metadata
Index int32 // Partition index
Offset int64 // Offset to commit
LeaderEpoch int32 // Leader epoch (-1 if not available)
Metadata string // Optional metadata
} }
// OffsetCommitResponse represents an OffsetCommit response to a Kafka client // OffsetCommitResponse represents an OffsetCommit response to a Kafka client
@ -61,7 +61,7 @@ type OffsetFetchRequest struct {
GroupID string GroupID string
GroupInstanceID string // Optional static membership ID GroupInstanceID string // Optional static membership ID
Topics []OffsetFetchTopic Topics []OffsetFetchTopic
RequireStable bool // Only fetch stable offsets
RequireStable bool // Only fetch stable offsets
} }
// OffsetFetchTopic represents topic-level offset fetch data // OffsetFetchTopic represents topic-level offset fetch data
@ -94,10 +94,10 @@ type OffsetFetchPartitionResponse struct {
// Error codes specific to offset management // Error codes specific to offset management
const ( const (
ErrorCodeInvalidCommitOffsetSize int16 = 28
ErrorCodeOffsetMetadataTooLarge int16 = 12
ErrorCodeOffsetLoadInProgress int16 = 14
ErrorCodeNotCoordinatorForGroup int16 = 16
ErrorCodeInvalidCommitOffsetSize int16 = 28
ErrorCodeOffsetMetadataTooLarge int16 = 12
ErrorCodeOffsetLoadInProgress int16 = 14
ErrorCodeNotCoordinatorForGroup int16 = 16
ErrorCodeGroupAuthorizationFailed int16 = 30 ErrorCodeGroupAuthorizationFailed int16 = 30
) )

Loading…
Cancel
Save