Documentation ¶
Index ¶
- type Model
- func (m *Model) CreatePartitionOwner(topic string, partition int32) error
- func (m *Model) DeleteGroupIfEmpty() error
- func (m *Model) DeletePartitionOwner(topic string, partition int32) error
- func (m *Model) EnsureMemberSubscription(topics []string) error
- func (m *Model) FetchGroupSubscriptions() (map[string][]string, <-chan none.T, context.CancelFunc, error)
- func (m *Model) GetPartitionOwner(topic string, partition int32) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model represent Kafka consumer group data model stored in ZooKeeper. It provides high level functions to deal with group member subscriptions and topic partition ownership. A model is bound to a particular member of a particular consumer group.
func (*Model) CreatePartitionOwner ¶
CreatePartitionOwner creates a partition owner znode, but only if none exists for the given topic-partition. An error is returned if a partition owner znode exists but belongs to another member.
func (*Model) DeleteGroupIfEmpty ¶
DeleteGroupIfEmpty deletes group data structures in ZooKeeper, if it is empty.
func (*Model) DeletePartitionOwner ¶
DeletePartitionOwner deletes a partition owner znode, but only if belongs to the bound member, an error is returned otherwise.
func (*Model) EnsureMemberSubscription ¶
EnsureMemberSubscription creates, updates or even deletes a member specification znode to ensure that the bound member is subscribed to the given topics.
func (*Model) FetchGroupSubscriptions ¶
func (m *Model) FetchGroupSubscriptions() (map[string][]string, <-chan none.T, context.CancelFunc, error)
FetchGroupSubscriptions retrieves bound group member specification records and returns memberID-to-topic-list map, along with a channel that will be sent a message when either the number of members or subscription of any of them changes.