base

package
v1.0.2-rc2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2022 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PairSplit = "&"
	KvSplit   = "="

	CompressorTypeKey = "compressorTypeKey"
	SerializerKey     = "serializerKey"

	// CheckUndoLogTableExistSql check undo log if exist
	CheckUndoLogTableExistSql = "SELECT 1 FROM " + constant.UndoLogTableName + " LIMIT 1"
	// DeleteUndoLogSql delete undo log
	DeleteUndoLogSql = constant.DeleteFrom + constant.UndoLogTableName + " WHERE " + constant.UndoLogBranchXid + " = ? AND " + constant.UndoLogXid + " = ?"
)
View Source
const (
	// UndoLogStatusNormal This state can be properly rolled back by services
	UndoLogStatusNormal = iota
	// UndoLogStatusGlobalFinished This state prevents the branch transaction from inserting undo_log after the global transaction is rolled back.
	UndoLogStatusGlobalFinished
)

undo log status

Variables

View Source
var (
	ErrorDeleteUndoLogParamsFault = errors.New("xid or branch_id can't nil")
)

checkUndoLogTableExistSql check undo log if exist

Functions

func Int64Slice2Str

func Int64Slice2Str(values interface{}, sep string) (string, error)

Int64Slice2Str

Types

type BaseUndoLogManager

type BaseUndoLogManager struct{}

BaseUndoLogManager

func NewBaseUndoLogManager

func NewBaseUndoLogManager() *BaseUndoLogManager

func (*BaseUndoLogManager) BatchDeleteUndoLog

func (m *BaseUndoLogManager) BatchDeleteUndoLog(xid []string, branchID []int64, conn *sql.Conn) error

BatchDeleteUndoLog exec delete undo log operate

func (*BaseUndoLogManager) DBType

func (m *BaseUndoLogManager) DBType() types.DBType

DBType

func (*BaseUndoLogManager) DecodeMap

func (m *BaseUndoLogManager) DecodeMap(str string) map[string]string

DecodeMap Decode undo log context string to map

func (*BaseUndoLogManager) DeleteUndoLog

func (m *BaseUndoLogManager) DeleteUndoLog(ctx context.Context, xid string, branchID int64, conn *sql.Conn) error

DeleteUndoLog exec delete single undo log operate

func (*BaseUndoLogManager) FlushUndoLog

func (m *BaseUndoLogManager) FlushUndoLog(tranCtx *types.TransactionContext, conn driver.Conn) error

FlushUndoLog flush undo log

func (*BaseUndoLogManager) HasUndoLogTable

func (m *BaseUndoLogManager) HasUndoLogTable(ctx context.Context, conn *sql.Conn) (res bool, err error)

HasUndoLogTable check undo log table if exist

func (*BaseUndoLogManager) Init

func (m *BaseUndoLogManager) Init()

Init

func (*BaseUndoLogManager) InsertUndoLog

func (m *BaseUndoLogManager) InsertUndoLog(record undo.UndologRecord, conn driver.Conn) error

InsertUndoLog

func (*BaseUndoLogManager) InsertUndoLogWithSqlConn

func (m *BaseUndoLogManager) InsertUndoLogWithSqlConn(ctx context.Context, record undo.UndologRecord, conn *sql.Conn) error

func (*BaseUndoLogManager) RunUndo

func (m *BaseUndoLogManager) RunUndo(ctx context.Context, xid string, branchID int64, conn *sql.DB, dbName string) error

RunUndo undo sql

func (*BaseUndoLogManager) Undo

func (m *BaseUndoLogManager) Undo(ctx context.Context, dbType types.DBType, xid string, branchID int64, db *sql.DB, dbName string) (err error)

Undo undo sql

Jump to

Keyboard shortcuts

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