Documentation
¶
Index ¶
- Constants
- Variables
- func Int64Slice2Str(values interface{}, sep string) (string, error)
- type BaseUndoLogManager
- func (m *BaseUndoLogManager) BatchDeleteUndoLog(xid []string, branchID []int64, conn *sql.Conn) error
- func (m *BaseUndoLogManager) DBType() types.DBType
- func (m *BaseUndoLogManager) DecodeMap(str string) map[string]string
- func (m *BaseUndoLogManager) DeleteUndoLog(ctx context.Context, xid string, branchID int64, conn *sql.Conn) error
- func (m *BaseUndoLogManager) FlushUndoLog(tranCtx *types.TransactionContext, conn driver.Conn) error
- func (m *BaseUndoLogManager) HasUndoLogTable(ctx context.Context, conn *sql.Conn) (res bool, err error)
- func (m *BaseUndoLogManager) Init()
- func (m *BaseUndoLogManager) InsertUndoLog(record undo.UndologRecord, conn driver.Conn) error
- func (m *BaseUndoLogManager) InsertUndoLogWithSqlConn(ctx context.Context, record undo.UndologRecord, conn *sql.Conn) error
- func (m *BaseUndoLogManager) RunUndo(ctx context.Context, xid string, branchID int64, conn *sql.DB, dbName string) error
- func (m *BaseUndoLogManager) Undo(ctx context.Context, dbType types.DBType, xid string, branchID int64, ...) (err error)
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 ¶
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) 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) 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
Click to show internal directories.
Click to hide internal directories.