consuming

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2023 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL