Documentation ¶
Index ¶
- type Consumer
- type ConsumerAwareHandle
- type ConsumerInfo
- type ConsumerState
- func (m *ConsumerState) AddConnection(tc *trackedConsumerHandler, consumer ConsumerInfo) (bool, int)
- func (m *ConsumerState) CanConsume(id string) (string, []TokenRanges, []string)
- func (m *ConsumerState) GetInfoForPeers() []ConsumerGroup
- func (m *ConsumerState) OffsetPolicy(connId string) OffsetResetPolicy
- func (m *ConsumerState) Rebalance() bool
- func (m *ConsumerState) RemoveConnection(id string) (bool, int)
- func (m *ConsumerState) SetInfoFromPeer(ordinal int, groups []ConsumerGroup)
- func (m *ConsumerState) TrackedConsumerById(id string) (*trackedConsumerHandler, *ConsumerInfo)
- func (m *ConsumerState) TrackedConsumers() []*trackedConsumerHandler
- type ReplicationReaderFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer interface {
Initializer
Closer
AcceptConnections() error
}
Consumer represents a consumer server
func NewConsumer ¶
func NewConsumer( config conf.ConsumerConfig, localDb localdb.Client, topologyGetter discovery.TopologyGetter, datalog data.Datalog, gossiper interbroker.Gossiper, ) Consumer
type ConsumerAwareHandle ¶
type ConsumerAwareHandle func(*trackedConsumerHandler, http.ResponseWriter, *http.Request, httprouter.Params) error
type ConsumerInfo ¶
type ConsumerInfo struct { Id string `json:"id"` // A unique id within the consumer group Group string `json:"group"` // A group unique id Topics []string `json:"topics"` OnNewGroup OffsetResetPolicy `json:"onNewGroup"` // contains filtered or unexported fields }
Represents a single consumer instance
type ConsumerState ¶
type ConsumerState struct {
// contains filtered or unexported fields
}
Represents a local view of the consumer instances.
func NewConsumerState ¶
func NewConsumerState(config conf.BasicConfig, topologyGetter discovery.TopologyGetter) *ConsumerState
func (*ConsumerState) AddConnection ¶
func (m *ConsumerState) AddConnection(tc *trackedConsumerHandler, consumer ConsumerInfo) (bool, int)
Add the new connection and returns the new number of connections
func (*ConsumerState) CanConsume ¶
func (m *ConsumerState) CanConsume(id string) (string, []TokenRanges, []string)
Returns the tokens and topics that a consumer should read
func (*ConsumerState) GetInfoForPeers ¶
func (m *ConsumerState) GetInfoForPeers() []ConsumerGroup
func (*ConsumerState) OffsetPolicy ¶
func (m *ConsumerState) OffsetPolicy(connId string) OffsetResetPolicy
func (*ConsumerState) Rebalance ¶
func (m *ConsumerState) Rebalance() bool
func (*ConsumerState) RemoveConnection ¶
func (m *ConsumerState) RemoveConnection(id string) (bool, int)
Removes the connection when found and returns the new number of connections.
func (*ConsumerState) SetInfoFromPeer ¶
func (m *ConsumerState) SetInfoFromPeer(ordinal int, groups []ConsumerGroup)
func (*ConsumerState) TrackedConsumerById ¶
func (m *ConsumerState) TrackedConsumerById(id string) (*trackedConsumerHandler, *ConsumerInfo)
func (*ConsumerState) TrackedConsumers ¶
func (m *ConsumerState) TrackedConsumers() []*trackedConsumerHandler
Gets a snapshot of the current consumers with tracked open connections
type ReplicationReaderFactory ¶
type ReplicationReaderFactory interface {
GetOrCreate(topic *TopicDataId, topology *TopologyInfo, topicGen *Generation, offsetState OffsetState) data.ReplicationReader
}
Click to show internal directories.
Click to hide internal directories.