2024-05-23 09:21:48 -07:00
|
|
|
package sub_coordinator
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/seaweedfs/seaweedfs/weed/mq/topic"
|
|
|
|
"github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"
|
|
|
|
)
|
|
|
|
|
2024-05-26 14:09:51 -07:00
|
|
|
type ConsumerGroupInstanceId string
|
|
|
|
|
2024-05-23 09:21:48 -07:00
|
|
|
type ConsumerGroupInstance struct {
|
2024-05-26 14:09:51 -07:00
|
|
|
InstanceId ConsumerGroupInstanceId
|
|
|
|
AssignedPartitions []topic.Partition
|
|
|
|
ResponseChan chan *mq_pb.SubscriberToSubCoordinatorResponse
|
|
|
|
MaxPartitionCount int32
|
2024-05-23 09:21:48 -07:00
|
|
|
}
|
|
|
|
|
2024-05-27 17:30:16 -07:00
|
|
|
func NewConsumerGroupInstance(instanceId string, maxPartitionCount int32) *ConsumerGroupInstance {
|
2024-05-23 09:21:48 -07:00
|
|
|
return &ConsumerGroupInstance{
|
2024-12-19 19:23:27 -08:00
|
|
|
InstanceId: ConsumerGroupInstanceId(instanceId),
|
|
|
|
ResponseChan: make(chan *mq_pb.SubscriberToSubCoordinatorResponse, 1),
|
2024-05-27 17:30:16 -07:00
|
|
|
MaxPartitionCount: maxPartitionCount,
|
2024-05-23 09:21:48 -07:00
|
|
|
}
|
|
|
|
}
|