Documentation ¶
Index ¶
- type EventRouter
- func (s *EventRouter) GetActiveTopics(activeTables []model.TableName) []string
- func (s *EventRouter) GetDefaultTopic() string
- func (s *EventRouter) GetPartitionDispatcher(schema, table string) partition.Dispatcher
- func (s *EventRouter) GetPartitionForRowChange(row *model.RowChangedEvent, partitionNum int32) (int32, string, error)
- func (s *EventRouter) GetTopicForDDL(ddl *model.DDLEvent) string
- func (s *EventRouter) GetTopicForRowChange(row *model.RowChangedEvent) string
- func (s *EventRouter) VerifyTables(infos []*model.TableInfo) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventRouter ¶
type EventRouter struct {
// contains filtered or unexported fields
}
EventRouter is a router, it determines which topic and which partition an event should be dispatched to.
func NewEventRouter ¶
func NewEventRouter( cfg *config.ReplicaConfig, protocol config.Protocol, defaultTopic, scheme string, ) (*EventRouter, error)
NewEventRouter creates a new EventRouter.
func (*EventRouter) GetActiveTopics ¶
func (s *EventRouter) GetActiveTopics(activeTables []model.TableName) []string
GetActiveTopics returns a list of the corresponding topics for the tables that are actively synchronized.
func (*EventRouter) GetDefaultTopic ¶
func (s *EventRouter) GetDefaultTopic() string
GetDefaultTopic returns the default topic name.
func (*EventRouter) GetPartitionDispatcher ¶
func (s *EventRouter) GetPartitionDispatcher(schema, table string) partition.Dispatcher
GetPartitionDispatcher returns the partition dispatcher for a specific table.
func (*EventRouter) GetPartitionForRowChange ¶
func (s *EventRouter) GetPartitionForRowChange( row *model.RowChangedEvent, partitionNum int32, ) (int32, string, error)
GetPartitionForRowChange returns the target partition for row changes.
func (*EventRouter) GetTopicForDDL ¶
func (s *EventRouter) GetTopicForDDL(ddl *model.DDLEvent) string
GetTopicForDDL returns the target topic for DDL.
func (*EventRouter) GetTopicForRowChange ¶
func (s *EventRouter) GetTopicForRowChange(row *model.RowChangedEvent) string
GetTopicForRowChange returns the target topic for row changes.
func (*EventRouter) VerifyTables ¶
func (s *EventRouter) VerifyTables(infos []*model.TableInfo) error
VerifyTables return error if any one table route rule is invalid.