broker

package
v0.0.0-...-2206af0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TopicPartitionFmt = "%s/%s_%02d"
)

Variables

This section is empty.

Functions

func PickMember

func PickMember(members []string, key []byte) string

Types

type Member

type Member string

func (Member) String

func (m Member) String() string

type MessageBroker

type MessageBroker struct {
	// contains filtered or unexported fields
}

func NewMessageBroker

func NewMessageBroker(option *MessageBrokerOption, grpcDialOption grpc.DialOption) (messageBroker *MessageBroker, err error)

func (*MessageBroker) AdjustedUrl

func (broker *MessageBroker) AdjustedUrl(hostAndPort string) string

func (*MessageBroker) ConfigureTopic

func (*MessageBroker) DeleteTopic

func (*MessageBroker) FindBroker

func (*MessageBroker) Publish

func (*MessageBroker) Subscribe

func (*MessageBroker) WithFilerClient

func (broker *MessageBroker) WithFilerClient(fn func(filer_pb.SeaweedFilerClient) error) (err error)

type MessageBrokerOption

type MessageBrokerOption struct {
	Filers             []string
	DefaultReplication string
	MaxMB              int
	Ip                 string
	Port               int
	Cipher             bool
}

type TopicControl

type TopicControl struct {
	sync.Mutex
	// contains filtered or unexported fields
}

type TopicManager

type TopicManager struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewTopicManager

func NewTopicManager(messageBroker *MessageBroker) *TopicManager

func (*TopicManager) ListTopicPartitions

func (tm *TopicManager) ListTopicPartitions() (tps []TopicPartition)

func (*TopicManager) ReleaseLock

func (tm *TopicManager) ReleaseLock(partition TopicPartition, isPublisher bool)

func (*TopicManager) RequestLock

func (tm *TopicManager) RequestLock(partition TopicPartition, topicConfig *messaging_pb.TopicConfiguration, isPublisher bool) *TopicControl

type TopicPartition

type TopicPartition struct {
	Namespace string
	Topic     string
	Partition int32
}

func (*TopicPartition) String

func (tp *TopicPartition) String() string

Jump to

Keyboard shortcuts

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