Documentation ¶
Index ¶
- Constants
- Variables
- func BuildDeleteUndoSql(undoLog *undolog.SqlUndoLog) string
- func BuildInsertUndoSql(undoLog *undolog.SqlUndoLog) string
- func BuildUpdateUndoSql(undoLog *undolog.SqlUndoLog) string
- func InitDistributedTransactionManager(conf *config.DistributedTransaction, storageDriver storage.Driver)
- type BuildUndoSql
- type DistributedTransactionManager
- func (manager *DistributedTransactionManager) Begin(ctx context.Context, transactionName string, timeout int32) (string, error)
- func (manager *DistributedTransactionManager) BranchRegister(ctx context.Context, in *api.BranchRegisterRequest) (string, int64, error)
- func (manager *DistributedTransactionManager) BranchReport(ctx context.Context, branchID string, status api.BranchSession_BranchStatus) error
- func (manager *DistributedTransactionManager) Commit(ctx context.Context, xid string) (api.GlobalSession_GlobalStatus, error)
- func (manager *DistributedTransactionManager) IsLockable(ctx context.Context, resourceID, lockKey string) (bool, error)
- func (manager *DistributedTransactionManager) IsRollingBackDead(bs *api.BranchSession) bool
- func (manager *DistributedTransactionManager) ReleaseLockKeys(ctx context.Context, resourceID string, lockKeys []string) (bool, error)
- func (manager *DistributedTransactionManager) Rollback(ctx context.Context, xid string) (api.GlobalSession_GlobalStatus, error)
- type MysqlUndoExecutor
- type MysqlUndoLogManager
- func (manager MysqlUndoLogManager) DeleteUndoLogByID(db proto.DB, id int64) error
- func (manager MysqlUndoLogManager) DeleteUndoLogByLogCreated(db proto.DB, logCreated time.Time, limitRows int) error
- func (manager MysqlUndoLogManager) DeleteUndoLogByXID(db proto.DB, xid string) error
- func (manager MysqlUndoLogManager) InsertUndoLogWithGlobalFinished(conn proto.Connection, xid string, branchID int64, undoLog *undolog.SqlUndoLog) error
- func (manager MysqlUndoLogManager) InsertUndoLogWithNormal(conn proto.Connection, xid string, branchID int64, undoLog *undolog.SqlUndoLog) error
- func (manager MysqlUndoLogManager) Undo(db proto.DB, xid string) ([]string, error)
- type RequestContext
- type State
Constants ¶
View Source
const ( // CommitRequestPath represents for tcc commit request path CommitRequestPath = "tcc_commit_request_path" // RollbackRequestPath represents for tcc rollback request path RollbackRequestPath = "tcc_rollback_request_path" // DefaultRetryDeadThreshold is max retry milliseconds DefaultRetryDeadThreshold = 130 * 1000 )
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 ( DeleteUndoLogByIDSql = "DELETE FROM undo_log WHERE id = ?" DeleteUndoLogByXIDSql = "DELETE FROM undo_log WHERE xid = ?" DeleteUndoLogByCreateSql = "DELETE FROM undo_log WHERE log_created <= ? LIMIT ?" InsertUndoLogSql = `` /* 139-byte string literal not displayed */ SelectUndoLogSql = `SELECT branch_id, context, rollback_info, log_status FROM undo_log WHERE xid = ? ORDER BY id DESC FOR UPDATE` )
Variables ¶
View Source
var ( VarHost = "host" VarQueryString = "queryString" )
Functions ¶
func BuildDeleteUndoSql ¶ added in v0.1.1
func BuildDeleteUndoSql(undoLog *undolog.SqlUndoLog) string
func BuildInsertUndoSql ¶ added in v0.1.1
func BuildInsertUndoSql(undoLog *undolog.SqlUndoLog) string
func BuildUpdateUndoSql ¶ added in v0.1.1
func BuildUpdateUndoSql(undoLog *undolog.SqlUndoLog) string
func InitDistributedTransactionManager ¶
func InitDistributedTransactionManager(conf *config.DistributedTransaction, storageDriver storage.Driver)
Types ¶
type BuildUndoSql ¶
type BuildUndoSql func(undoLog undolog.SqlUndoLog) string
type DistributedTransactionManager ¶
type DistributedTransactionManager struct {
// contains filtered or unexported fields
}
func GetDistributedTransactionManager ¶
func GetDistributedTransactionManager() *DistributedTransactionManager
func (*DistributedTransactionManager) BranchRegister ¶
func (manager *DistributedTransactionManager) BranchRegister(ctx context.Context, in *api.BranchRegisterRequest) (string, int64, error)
func (*DistributedTransactionManager) BranchReport ¶
func (manager *DistributedTransactionManager) BranchReport(ctx context.Context, branchID string, status api.BranchSession_BranchStatus) error
func (*DistributedTransactionManager) Commit ¶
func (manager *DistributedTransactionManager) Commit(ctx context.Context, xid string) (api.GlobalSession_GlobalStatus, error)
func (*DistributedTransactionManager) IsLockable ¶
func (*DistributedTransactionManager) IsRollingBackDead ¶
func (manager *DistributedTransactionManager) IsRollingBackDead(bs *api.BranchSession) bool
func (*DistributedTransactionManager) ReleaseLockKeys ¶
func (*DistributedTransactionManager) Rollback ¶
func (manager *DistributedTransactionManager) Rollback(ctx context.Context, xid string) (api.GlobalSession_GlobalStatus, error)
type MysqlUndoExecutor ¶
type MysqlUndoExecutor struct {
// contains filtered or unexported fields
}
func NewMysqlUndoExecutor ¶
func NewMysqlUndoExecutor(undoLog *undolog.SqlUndoLog) MysqlUndoExecutor
type MysqlUndoLogManager ¶
type MysqlUndoLogManager struct { }
func GetUndoLogManager ¶
func GetUndoLogManager() MysqlUndoLogManager
func (MysqlUndoLogManager) DeleteUndoLogByID ¶
func (manager MysqlUndoLogManager) DeleteUndoLogByID(db proto.DB, id int64) error
func (MysqlUndoLogManager) DeleteUndoLogByLogCreated ¶
func (MysqlUndoLogManager) DeleteUndoLogByXID ¶
func (manager MysqlUndoLogManager) DeleteUndoLogByXID(db proto.DB, xid string) error
func (MysqlUndoLogManager) InsertUndoLogWithGlobalFinished ¶
func (manager MysqlUndoLogManager) InsertUndoLogWithGlobalFinished(conn proto.Connection, xid string, branchID int64, undoLog *undolog.SqlUndoLog) error
func (MysqlUndoLogManager) InsertUndoLogWithNormal ¶
func (manager MysqlUndoLogManager) InsertUndoLogWithNormal(conn proto.Connection, xid string, branchID int64, undoLog *undolog.SqlUndoLog) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.