Documentation
¶
Index ¶
- func PostUnmarshal(r *RedoLog)
- func PreMarshal(r *RedoLog)
- type Column
- type DDLEvent
- type RedoColumn
- type RedoDDLEvent
- func (z *RedoDDLEvent) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *RedoDDLEvent) EncodeMsg(en *msgp.Writer) (err error)
- func (z *RedoDDLEvent) MarshalMsg(b []byte) (o []byte, err error)
- func (z *RedoDDLEvent) Msgsize() (s int)
- func (z *RedoDDLEvent) UnmarshalMsg(bts []byte) (o []byte, err error)
- type RedoLog
- type RedoLogType
- type RedoRowChangedEvent
- func (z *RedoRowChangedEvent) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *RedoRowChangedEvent) EncodeMsg(en *msgp.Writer) (err error)
- func (z *RedoRowChangedEvent) MarshalMsg(b []byte) (o []byte, err error)
- func (z *RedoRowChangedEvent) Msgsize() (s int)
- func (z *RedoRowChangedEvent) UnmarshalMsg(bts []byte) (o []byte, err error)
- type RowChangedEvent
- func (z *RowChangedEvent) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *RowChangedEvent) EncodeMsg(en *msgp.Writer) (err error)
- func (z *RowChangedEvent) MarshalMsg(b []byte) (o []byte, err error)
- func (z *RowChangedEvent) Msgsize() (s int)
- func (z *RowChangedEvent) UnmarshalMsg(bts []byte) (o []byte, err error)
- type TableName
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.
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) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
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) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type RedoColumn ¶
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 ¶
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) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
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) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler