dispatcher

package
v0.0.0-...-64decf6 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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