Documentation ¶
Overview ¶
Package metadata defines all the metadata of the TubeMQ broker and producer.
Index ¶
- Constants
- type ConsumeData
- type ConsumerEvent
- func (c *ConsumerEvent) GetEventStatus() int32
- func (c *ConsumerEvent) GetEventType() int32
- func (c *ConsumerEvent) GetRebalanceID() int64
- func (c *ConsumerEvent) GetSubscribeInfo() []*SubscribeInfo
- func (c *ConsumerEvent) SetEventStatus(eventStatus int32)
- func (c *ConsumerEvent) SetEventType(eventType int32)
- type Metadata
- func (m *Metadata) GetNode() *Node
- func (m *Metadata) GetReadStatus() int32
- func (m *Metadata) GetReportTimes() bool
- func (m *Metadata) GetSubscribeInfo() *SubscribeInfo
- func (m *Metadata) SetNode(node *Node)
- func (m *Metadata) SetReadStatus(status int32)
- func (m *Metadata) SetReportTimes(reportTimes bool)
- func (m *Metadata) SetSubscribeInfo(sub *SubscribeInfo)
- type Node
- type Partition
- func (p *Partition) BookConsumeData(data *ConsumeData)
- func (p *Partition) GetBroker() *Node
- func (p *Partition) GetDelayTimestamp() int64
- func (p *Partition) GetLastConsumed() bool
- func (p *Partition) GetPartitionID() int32
- func (p *Partition) GetPartitionKey() string
- func (p *Partition) GetTopic() string
- func (p *Partition) ProcConsumeResult(defHandler *flowctrl.RuleHandler, groupHandler *flowctrl.RuleHandler, ...) int64
- func (p *Partition) SetLastConsumed(lastConsumed bool)
- func (p *Partition) String() string
- type SubscribeInfo
- func (s *SubscribeInfo) GetConsumerID() string
- func (s *SubscribeInfo) GetGroup() string
- func (s *SubscribeInfo) GetPartition() *Partition
- func (s *SubscribeInfo) SetConsumerID(id string)
- func (s *SubscribeInfo) SetGroup(group string)
- func (s *SubscribeInfo) SetPartition(partition *Partition)
- func (s *SubscribeInfo) String() string
- type TopicInfo
Constants ¶
const ( Disconnect = 2 OnlyDisconnect = 20 Connect = 1 OnlyConnect = 10 )
const ( Todo = 0 Processing = 1 Done = 2 Unknown = -1 Failed = -2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsumeData ¶
type ConsumeData struct {
// contains filtered or unexported fields
}
ConsumeData represents the consumption metadata of a partition.
func NewConsumeData ¶
func NewConsumeData(time int64, errCode int32, escLimit bool, msgSize int32, dltLimit int64, curDataDlt int64, requireSlow bool) *ConsumeData
NewConsumeData returns a consume data.
type ConsumerEvent ¶
type ConsumerEvent struct {
// contains filtered or unexported fields
}
ConsumerEvent represents the metadata of a consumer event
func NewEvent ¶
func NewEvent(rebalanceID int64, eventType int32, subscribeInfo []*SubscribeInfo) *ConsumerEvent
NewEvent returns a new consumer event.
func (*ConsumerEvent) GetEventStatus ¶
func (c *ConsumerEvent) GetEventStatus() int32
GetEventStatus returns the event status of a consumer event.
func (*ConsumerEvent) GetEventType ¶
func (c *ConsumerEvent) GetEventType() int32
GetEventType returns the event type of a consumer event.
func (*ConsumerEvent) GetRebalanceID ¶
func (c *ConsumerEvent) GetRebalanceID() int64
GetRebalanceID returns the rebalanceID of a consumer event.
func (*ConsumerEvent) GetSubscribeInfo ¶
func (c *ConsumerEvent) GetSubscribeInfo() []*SubscribeInfo
GetSubscribeInfo returns the list of SubscribeInfo of a consumer event.
func (*ConsumerEvent) SetEventStatus ¶
func (c *ConsumerEvent) SetEventStatus(eventStatus int32)
SetEventStatus sets the event status.
func (*ConsumerEvent) SetEventType ¶
func (c *ConsumerEvent) SetEventType(eventType int32)
SetEventType sets the event type.
type Metadata ¶
type Metadata struct {
// contains filtered or unexported fields
}
Metadata represents the metadata of
func (*Metadata) GetReadStatus ¶
GetReadStatus returns the read status.
func (*Metadata) GetReportTimes ¶
GetReportTimes returns the report times.
func (*Metadata) GetSubscribeInfo ¶
func (m *Metadata) GetSubscribeInfo() *SubscribeInfo
GetSubscribeInfo returns the SubscribeInfo of the metadata.
func (*Metadata) SetReadStatus ¶
SetReadStatus sets the status.
func (*Metadata) SetReportTimes ¶
SetReportTimes sets the reportTimes.
func (*Metadata) SetSubscribeInfo ¶
func (m *Metadata) SetSubscribeInfo(sub *SubscribeInfo)
SetSubscribeInfo sets the subscribeInfo.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node represents the metadata of a node.
func NewNode ¶
NewNode constructs a node from a given string. If the given string is invalid, it will return error. The format of node string: nodeID:host:port
func (*Node) GetAddress ¶
GetAddress returns the address of a node.
func (*Node) SetAddress ¶
SetAddress sets the address.
type Partition ¶
type Partition struct {
// contains filtered or unexported fields
}
Partition represents the metadata of a partition.
func NewPartition ¶
NewPartition parses a partition from the given string. The format of partition string: brokerInfo#topic:partitionId
func (*Partition) BookConsumeData ¶
func (p *Partition) BookConsumeData(data *ConsumeData)
BookConsumeData sets the consumeData.
func (*Partition) GetDelayTimestamp ¶
func (*Partition) GetLastConsumed ¶
GetLastConsumed returns lastConsumed of a partition.
func (*Partition) GetPartitionID ¶
GetPartitionID returns the partition id of a partition.
func (*Partition) GetPartitionKey ¶
GetPartitionKey returns the partition key of a partition.
func (*Partition) ProcConsumeResult ¶
func (p *Partition) ProcConsumeResult(defHandler *flowctrl.RuleHandler, groupHandler *flowctrl.RuleHandler, filterConsume bool, lastConsumed bool) int64
ProcConsumeResult processes consume result.
func (*Partition) SetLastConsumed ¶
SetLastConsumed sets the last consumed.
type SubscribeInfo ¶
type SubscribeInfo struct {
// contains filtered or unexported fields
}
SubscribeInfo represents the metadata of the subscribe info.
func NewSubscribeInfo ¶
func NewSubscribeInfo(subscribeInfo string) (*SubscribeInfo, error)
NewSubscribeInfo constructs a SubscribeInfo from a given string. If the given is invalid, it will return error. The format of subscribeInfo string: consumerId@group#broker_info#topic:partitionId
func (*SubscribeInfo) GetConsumerID ¶
func (s *SubscribeInfo) GetConsumerID() string
GetConsumerID returns the consumer id.
func (*SubscribeInfo) GetGroup ¶
func (s *SubscribeInfo) GetGroup() string
GetGroup returns the group name.
func (*SubscribeInfo) GetPartition ¶
func (s *SubscribeInfo) GetPartition() *Partition
GetPartition returns the partition.
func (*SubscribeInfo) SetConsumerID ¶
func (s *SubscribeInfo) SetConsumerID(id string)
SetConsumerID sets the consumerID.
func (*SubscribeInfo) SetGroup ¶
func (s *SubscribeInfo) SetGroup(group string)
SetGroup sets the group.
func (*SubscribeInfo) SetPartition ¶
func (s *SubscribeInfo) SetPartition(partition *Partition)
SetPartition sets the partition.
func (*SubscribeInfo) String ¶
func (s *SubscribeInfo) String() string
String returns the contents of SubscribeInfo as a string.
type TopicInfo ¶
type TopicInfo struct {
// contains filtered or unexported fields
}
func NewTopicInfo ¶
New topicinfo