transformer

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	Ignore       bool          // whether the event should be ignored
	IgnoreReason string        // why the transformer ignore the event
	LogPos       uint32        // binlog event's End_log_pos or Position in RotateEvent
	NextLogName  string        // next binlog filename, only valid for RotateEvent
	GTIDSet      mysql.GTIDSet // GTIDSet got from QueryEvent and XIDEvent when RawModeEnabled not true
	CanSaveGTID  bool          // whether can save GTID into meta, true for DDL query and XIDEvent
}

Result represents a transform result.

type Transformer

type Transformer interface {
	// Transform transforms a binlog event.
	Transform(e *replication.BinlogEvent) Result
}

Transformer receives binlog events from a reader and transforms them. The transformed binlog events should be send to one or more writers. The transformer should support:

  1. extract binlog position, GTID info from the event.
  2. decide the event whether needed by a downstream writer. - the downstream writer may also drop some events according to its strategy.

NOTE: more features maybe moved from outer into Transformer later.

func NewTransformer

func NewTransformer(parser2 *parser.Parser) Transformer

NewTransformer creates a Transformer instance.

Jump to

Keyboard shortcuts

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