model

package
v0.1.25 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPartition = "default"

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker struct {
	ID uint64

	RaftAddress      string
	ReachGrpcAddress string
	ReachHttpAddress string

	StartMsgFSM chan *Partition
	// contains filtered or unexported fields
}

func FromProtoBufBroker added in v0.1.20

func FromProtoBufBroker(pb *pbTypes.Broker) *Broker

func (*Broker) BrokerShardId

func (b *Broker) BrokerShardId() uint64

func (*Broker) JoinShard added in v0.1.21

func (b *Broker) JoinShard(partition *Partition)

func (*Broker) NodeHost

func (b *Broker) NodeHost() *dragonboat.NodeHost

func (*Broker) SetBrokerShardId

func (b *Broker) SetBrokerShardId(brokerShardId uint64)

func (*Broker) SetNodeHost

func (b *Broker) SetNodeHost(nh *dragonboat.NodeHost)

func (*Broker) ShardForPartition

func (b *Broker) ShardForPartition(partition string) (uint64, bool)

func (*Broker) ToProtoBuf added in v0.1.20

func (b *Broker) ToProtoBuf() *pbTypes.Broker

type Consumer

type Consumer struct {
	ID            string
	Partitions    []string
	ConsumerGroup string
	Topics        []string
	IsActive      bool

	LastHealthCheckAt int64
	// contains filtered or unexported fields
}

func FromProtoBufConsumer added in v0.1.20

func FromProtoBufConsumer(pbConsumer *pbTypes.Consumer) *Consumer

func (*Consumer) GetCurrentPartition

func (c *Consumer) GetCurrentPartition() string

func (*Consumer) IncPartitionIndex

func (c *Consumer) IncPartitionIndex() int

func (*Consumer) PartitionIndex

func (c *Consumer) PartitionIndex() int

func (*Consumer) SetPartitions

func (c *Consumer) SetPartitions(partitions []string)

func (*Consumer) String

func (c *Consumer) String() string

func (*Consumer) ToProtoBuf added in v0.1.20

func (c *Consumer) ToProtoBuf() *pbTypes.Consumer

type ConsumerGroup

type ConsumerGroup struct {
	ID        string
	Topics    map[string]bool
	Consumers map[string]bool
	// contains filtered or unexported fields
}

func FromProtoBufConsumerGroup added in v0.1.20

func FromProtoBufConsumerGroup(pb *pbTypes.ConsumerGroup) *ConsumerGroup

func (*ConsumerGroup) AddConsumer

func (c *ConsumerGroup) AddConsumer(consumerID string)

func (*ConsumerGroup) RebalanceInProgress

func (c *ConsumerGroup) RebalanceInProgress() bool

func (*ConsumerGroup) SetRebalanceInProgress

func (c *ConsumerGroup) SetRebalanceInProgress(inProgress bool)

func (*ConsumerGroup) String

func (c *ConsumerGroup) String() string

func (*ConsumerGroup) ToProtoBuf added in v0.1.20

func (c *ConsumerGroup) ToProtoBuf() *pbTypes.ConsumerGroup

type Message

type Message struct {
	Topic        string
	PartitionKey string
	PartitionID  string
	Data         []byte
	ID           []byte
}

func FromProtoBufMessage added in v0.1.20

func FromProtoBufMessage(pbMessage *pbTypes.Message) *Message

func (*Message) String

func (m *Message) String() string

func (*Message) ToProtoBuf added in v0.1.20

func (m *Message) ToProtoBuf() *pbTypes.Message

type Partition

type Partition struct {
	ID        string
	TopicName string
	ShardID   uint64
	Members   map[uint64]string
}

func FromProtoBufPartition added in v0.1.20

func FromProtoBufPartition(pb *pbTypes.Partition) *Partition

func (*Partition) ToProtoBuf added in v0.1.20

func (m *Partition) ToProtoBuf() *pbTypes.Partition

type ShardInfo added in v0.1.3

type ShardInfo struct {
	ShardType   ShardType
	ShardID     uint64
	Topic       string
	PartitionID string
	Brokers     []*Broker
}

func FromProtoBufShardInfo added in v0.1.20

func FromProtoBufShardInfo(pb *pbTypes.ShardInfo) *ShardInfo

func (*ShardInfo) ToProtoBuf added in v0.1.20

func (s *ShardInfo) ToProtoBuf() *pbTypes.ShardInfo

type ShardType added in v0.1.3

type ShardType string
const (
	ShardTypeBrokers    ShardType = "BROKERS"
	ShardTypePartitions ShardType = "PARTITIONS"
)

type Topic

type Topic struct {
	Name               string
	NumberOfPartitions uint64
}

func FromProtoBufTopic added in v0.1.20

func FromProtoBufTopic(pb *pbTypes.Topic) *Topic

func (*Topic) String

func (t *Topic) String() string

func (*Topic) ToProtoBuf added in v0.1.20

func (t *Topic) ToProtoBuf() *pbTypes.Topic

Jump to

Keyboard shortcuts

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