manager

package
v0.1.10-0...-9bf53c4 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InsertSqlTemplate = "INSERT INTO %s (%s) VALUES (%s)"
	DeleteSqlTemplate = "DELETE FROM %s WHERE `%s` = ?"
	UpdateSqlTemplate = "UPDATE %s SET %s WHERE `%s` = ?"
	SelectSqlTemplate = "SELECT %s FROM %s WHERE `%s` IN %s"
)
View Source
const (
	DeleteUndoLogSql         = "DELETE FROM undo_log WHERE xid = ? and branch_id = ?"
	DeleteUndoLogByCreateSql = "DELETE FROM undo_log WHERE log_created <= ? LIMIT ?"
	InsertUndoLogSql         = `` /* 140-byte string literal not displayed */

	SelectUndoLogSql = `SELECT branch_id, xid, context, rollback_info, log_status FROM undo_log 
        WHERE branch_id = ? AND xid = ? FOR UPDATE`
)

Variables

This section is empty.

Functions

func DeleteBuildUndoSql

func DeleteBuildUndoSql(undoLog undo.SqlUndoLog) string

func InsertBuildUndoSql

func InsertBuildUndoSql(undoLog undo.SqlUndoLog) string

func UpdateBuildUndoSql

func UpdateBuildUndoSql(undoLog undo.SqlUndoLog) string

Types

type BuildUndoSql

type BuildUndoSql func(undoLog undo.SqlUndoLog) string

type MysqlUndoExecutor

type MysqlUndoExecutor struct {
	// contains filtered or unexported fields
}

func NewMysqlUndoExecutor

func NewMysqlUndoExecutor(undoLog undo.SqlUndoLog) MysqlUndoExecutor

func (MysqlUndoExecutor) Execute

func (executor MysqlUndoExecutor) Execute(tx *sql.Tx) error

type MysqlUndoLogManager

type MysqlUndoLogManager struct {
}

func (MysqlUndoLogManager) BatchDeleteUndoLog

func (manager MysqlUndoLogManager) BatchDeleteUndoLog(db *sql.DB, xids []string, branchIds []int64) error

func (MysqlUndoLogManager) DeleteUndoLog

func (manager MysqlUndoLogManager) DeleteUndoLog(db *sql.DB, xid string, branchId int64) error

func (MysqlUndoLogManager) DeleteUndoLogByLogCreated

func (manager MysqlUndoLogManager) DeleteUndoLogByLogCreated(db *sql.DB, logCreated time.Time, limitRows int) (sql.Result, error)

func (MysqlUndoLogManager) FlushUndoLogs

func (manager MysqlUndoLogManager) FlushUndoLogs(tx *proxy_tx.ProxyTx) error

func (MysqlUndoLogManager) Undo

func (manager MysqlUndoLogManager) Undo(db *sql.DB, xid string, branchId int64, resourceId string) error

type State

type State byte
const (
	Normal State = iota
	GlobalFinished
)

func (State) String

func (state State) String() string

type UndoLogManager

type UndoLogManager interface {
	FlushUndoLogs(tx *proxy_tx.ProxyTx) error

	Undo(db *sql.DB, xid string, branchId int64, resourceId string) error

	DeleteUndoLog(db *sql.DB, xid string, branchId int64) error

	BatchDeleteUndoLog(db *sql.DB, xids []string, branchIds []int64) error

	DeleteUndoLogByLogCreated(db *sql.DB, logCreated time.Time, limitRows int) (sql.Result, error)
}

func GetUndoLogManager

func GetUndoLogManager() UndoLogManager

Jump to

Keyboard shortcuts

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