partition_list.go 636 B

12345678910111213141516171819202122232425
  1. package sub_coordinator
  2. import "time"
  3. type PartitionSlotToConsumerInstance struct {
  4. RangeStart int32
  5. RangeStop int32
  6. UnixTimeNs int64
  7. Broker string
  8. AssignedInstanceId ConsumerGroupInstanceId
  9. FollowerBroker string
  10. }
  11. type PartitionSlotToConsumerInstanceList struct {
  12. PartitionSlots []*PartitionSlotToConsumerInstance
  13. RingSize int32
  14. Version int64
  15. }
  16. func NewPartitionSlotToConsumerInstanceList(ringSize int32, version time.Time) *PartitionSlotToConsumerInstanceList {
  17. return &PartitionSlotToConsumerInstanceList{
  18. RingSize: ringSize,
  19. Version: version.UnixNano(),
  20. }
  21. }