v1

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PostUnmarshal

func PostUnmarshal(r *RedoLog)

PostUnmarshal should be called after unmarshal a RedoLog.

func PreMarshal

func PreMarshal(r *RedoLog)

PreMarshal should be called before marshal a RedoLog.

Types

type Column

type Column struct {
	Name    string               `json:"name" msg:"name"`
	Type    byte                 `json:"type" msg:"type"`
	Charset string               `json:"charset" msg:"charset"`
	Flag    model.ColumnFlagType `json:"flag" msg:"-"`
	Value   interface{}          `json:"value" msg:"value"`
	Default interface{}          `json:"default" msg:"-"`

	// ApproximateBytes is approximate bytes consumed by the column.
	ApproximateBytes int `json:"-"`
}

Column represents a column value in row changed event

func (*Column) DecodeMsg

func (z *Column) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Column) EncodeMsg

func (z *Column) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Column) MarshalMsg

func (z *Column) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Column) Msgsize

func (z *Column) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Column) UnmarshalMsg

func (z *Column) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type DDLEvent

type DDLEvent struct {
	StartTs      uint64             `msg:"start-ts"`
	CommitTs     uint64             `msg:"commit-ts"`
	Query        string             `msg:"query"`
	TableInfo    *model.TableInfo   `msg:"-"`
	PreTableInfo *model.TableInfo   `msg:"-"`
	Type         timodel.ActionType `msg:"-"`
	Done         bool               `msg:"-"`
}

DDLEvent stores DDL event

func (*DDLEvent) DecodeMsg

func (z *DDLEvent) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (DDLEvent) EncodeMsg

func (z DDLEvent) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (DDLEvent) MarshalMsg

func (z DDLEvent) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (DDLEvent) Msgsize

func (z DDLEvent) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*DDLEvent) UnmarshalMsg

func (z *DDLEvent) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type RedoColumn

type RedoColumn struct {
	Column *Column `msg:"column"`
	Flag   uint64  `msg:"flag"`
}

RedoColumn stores Column change

func (*RedoColumn) DecodeMsg

func (z *RedoColumn) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*RedoColumn) EncodeMsg

func (z *RedoColumn) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*RedoColumn) MarshalMsg

func (z *RedoColumn) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*RedoColumn) Msgsize

func (z *RedoColumn) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*RedoColumn) UnmarshalMsg

func (z *RedoColumn) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type RedoDDLEvent

type RedoDDLEvent struct {
	DDL  *DDLEvent `msg:"ddl"`
	Type byte      `msg:"type"`
}

RedoDDLEvent represents DDL event used in redo log persistent

func (*RedoDDLEvent) DecodeMsg

func (z *RedoDDLEvent) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*RedoDDLEvent) EncodeMsg

func (z *RedoDDLEvent) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*RedoDDLEvent) MarshalMsg

func (z *RedoDDLEvent) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*RedoDDLEvent) Msgsize

func (z *RedoDDLEvent) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*RedoDDLEvent) UnmarshalMsg

func (z *RedoDDLEvent) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type RedoLog

type RedoLog struct {
	RedoRow *RedoRowChangedEvent `msg:"row"`
	RedoDDL *RedoDDLEvent        `msg:"ddl"`
	Type    RedoLogType          `msg:"type"`
}

RedoLog defines the persistent structure of redo log since MsgPack do not support types that are defined in another package, more info https://github.com/tinylib/msgp/issues/158, https://github.com/tinylib/msgp/issues/149 so define a RedoColumn, RedoDDLEvent instead of using the Column, DDLEvent

func (*RedoLog) DecodeMsg

func (z *RedoLog) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*RedoLog) EncodeMsg

func (z *RedoLog) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*RedoLog) MarshalMsg

func (z *RedoLog) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*RedoLog) Msgsize

func (z *RedoLog) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*RedoLog) UnmarshalMsg

func (z *RedoLog) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type RedoLogType

type RedoLogType int

RedoLogType is the type of log

func (*RedoLogType) DecodeMsg

func (z *RedoLogType) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (RedoLogType) EncodeMsg

func (z RedoLogType) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (RedoLogType) MarshalMsg

func (z RedoLogType) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (RedoLogType) Msgsize

func (z RedoLogType) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*RedoLogType) UnmarshalMsg

func (z *RedoLogType) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type RedoRowChangedEvent

type RedoRowChangedEvent struct {
	Row        *RowChangedEvent `msg:"row"`
	PreColumns []*RedoColumn    `msg:"pre-columns"`
	Columns    []*RedoColumn    `msg:"columns"`
}

RedoRowChangedEvent represents the DML event used in RedoLog

func (*RedoRowChangedEvent) DecodeMsg

func (z *RedoRowChangedEvent) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*RedoRowChangedEvent) EncodeMsg

func (z *RedoRowChangedEvent) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*RedoRowChangedEvent) MarshalMsg

func (z *RedoRowChangedEvent) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*RedoRowChangedEvent) Msgsize

func (z *RedoRowChangedEvent) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*RedoRowChangedEvent) UnmarshalMsg

func (z *RedoRowChangedEvent) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type RowChangedEvent

type RowChangedEvent struct {
	StartTs  uint64 `json:"start-ts" msg:"start-ts"`
	CommitTs uint64 `json:"commit-ts" msg:"commit-ts"`

	RowID int64 `json:"row-id" msg:"-"` // Deprecated. It is empty when the RowID comes from clustered index table.

	Table     *TableName         `json:"table" msg:"table"`
	ColInfos  []rowcodec.ColInfo `json:"column-infos" msg:"-"`
	TableInfo *model.TableInfo   `json:"-" msg:"-"`

	Columns      []*Column `json:"columns" msg:"-"`
	PreColumns   []*Column `json:"pre-columns" msg:"-"`
	IndexColumns [][]int   `json:"-" msg:"index-columns"`

	// ApproximateDataSize is the approximate size of protobuf binary
	// representation of this event.
	ApproximateDataSize int64 `json:"-" msg:"-"`

	// SplitTxn marks this RowChangedEvent as the first line of a new txn.
	SplitTxn bool `json:"-" msg:"-"`
	// ReplicatingTs is ts when a table starts replicating events to downstream.
	ReplicatingTs model.Ts `json:"-" msg:"-"`
}

RowChangedEvent represents a row changed event

func (*RowChangedEvent) DecodeMsg

func (z *RowChangedEvent) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*RowChangedEvent) EncodeMsg

func (z *RowChangedEvent) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*RowChangedEvent) MarshalMsg

func (z *RowChangedEvent) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*RowChangedEvent) Msgsize

func (z *RowChangedEvent) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*RowChangedEvent) UnmarshalMsg

func (z *RowChangedEvent) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type TableName

type TableName struct {
	Schema      string `toml:"db-name" json:"db-name" msg:"db-name"`
	Table       string `toml:"tbl-name" json:"tbl-name" msg:"tbl-name"`
	TableID     int64  `toml:"tbl-id" json:"tbl-id" msg:"tbl-id"`
	IsPartition bool   `toml:"is-partition" json:"is-partition" msg:"is-partition"`
}

TableName represents name of a table, includes table name and schema name.

func (*TableName) DecodeMsg

func (z *TableName) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*TableName) EncodeMsg

func (z *TableName) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*TableName) MarshalMsg

func (z *TableName) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*TableName) Msgsize

func (z *TableName) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*TableName) UnmarshalMsg

func (z *TableName) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

Jump to

Keyboard shortcuts

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