filter

package
v0.0.0-...-b2a4f9a Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 32 Imported by: 6

Documentation

Index

Constants

View Source
const (
	// SyncPointTable is the tale name use to write ts-map when sync-point is enable.
	SyncPointTable = "syncpoint_v1"
	// TiCDCSystemSchema is the schema only use by TiCDC.
	TiCDCSystemSchema = "tidb_cdc"
	// LightningTaskInfoSchema is the schema only generated by Lightning
	LightningTaskInfoSchema = "lightning_task_info"
)

Variables

This section is empty.

Functions

func IsSchemaDDL

func IsSchemaDDL(actionType timodel.ActionType) bool

IsSchemaDDL returns true if the action type is a schema DDL.

func SupportedEventTypes

func SupportedEventTypes() []bf.EventType

SupportedEventTypes returns the supported event types.

func VerifyTableRules

func VerifyTableRules(cfg *config.FilterConfig) (tfilter.Filter, error)

VerifyTableRules checks the table filter rules in the configuration and returns an invalid rule error if the verification fails, otherwise it will return a table filter.

Types

type Filter

type Filter interface {
	// ShouldIgnoreDMLEvent returns true if the DML event should be ignored.
	ShouldIgnoreDMLEvent(dml *model.RowChangedEvent, rawRow model.RowChangedDatums, tableInfo *model.TableInfo) (bool, error)
	// ShouldIgnoreDDLEvent returns true if the DDL event should be ignored.
	// If a ddl is ignored, it will be applied to cdc's schema storage,
	// but will not be sent to downstream.
	ShouldIgnoreDDLEvent(ddl *model.DDLEvent) (bool, error)
	// ShouldDiscardDDL returns true if this DDL should be discarded.
	// If a ddl is discarded, it will neither be applied to cdc's schema storage
	// nor sent to downstream.
	ShouldDiscardDDL(ddlType timodel.ActionType, schema, table string) bool
	// ShouldIgnoreTable returns true if the table should be ignored.
	ShouldIgnoreTable(schema, table string) bool
	// ShouldIgnoreSchema returns true if the schema should be ignored.
	ShouldIgnoreSchema(schema string) bool
	// Verify should only be called by create changefeed OpenAPI.
	// Its purpose is to verify the expression filter config.
	Verify(tableInfos []*model.TableInfo) error
}

Filter are safe for concurrent use. TODO: find a better way to abstract this interface.

func NewFilter

func NewFilter(cfg *config.ReplicaConfig, tz string) (Filter, error)

NewFilter creates a filter.

Jump to

Keyboard shortcuts

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