Versions in this module Expand all Collapse all v1 v1.0.4 Aug 8, 2022 Changes in this version + const BatchDeleteLockByBranchID + const BucketPerTable + const GetLockDOCount + const LOCK_SPLIT + func Init() + type DataBaseLocker struct + LockStore LockStore + func (locker *DataBaseLocker) AcquireLock(branchSession *session.BranchSession) bool + func (locker *DataBaseLocker) CleanAllLocks() + func (locker *DataBaseLocker) GetLockKeyCount() int64 + func (locker *DataBaseLocker) IsLockable(xid string, resourceID string, lockKey string) bool + func (locker *DataBaseLocker) ReleaseGlobalSessionLock(globalSession *session.GlobalSession) bool + func (locker *DataBaseLocker) ReleaseLock(branchSession *session.BranchSession) bool + type LockManager interface + AcquireLock func(branchSession *session.BranchSession) bool + CleanAllLocks func() + GetLockKeyCount func() int64 + IsLockable func(xid string, resourceID string, lockKey string) bool + ReleaseGlobalSessionLock func(globalSession *session.GlobalSession) bool + ReleaseLock func(branchSession *session.BranchSession) bool + func GetLockManager() LockManager + type LockStore interface + AcquireLock func(lockDOs []*model.LockDO) bool + AcquireLockByLockDO func(lockDO *model.LockDO) bool + GetLockCount func() int64 + IsLockable func(lockDOs []*model.LockDO) bool + UnLock func(lockDOs []*model.LockDO) bool + UnLockByLockDO func(lockDO *model.LockDO) bool + UnLockByXIDAndBranchID func(xid string, branchID int64) bool + UnLockByXIDAndBranchIDs func(xid string, branchIDs []int64) bool + type LockStoreDataBaseDao struct + func (dao *LockStoreDataBaseDao) AcquireLock(lockDOs []*model.LockDO) bool + func (dao *LockStoreDataBaseDao) AcquireLockByLockDO(lockDO *model.LockDO) bool + func (dao *LockStoreDataBaseDao) GetLockCount() int64 + func (dao *LockStoreDataBaseDao) IsLockable(lockDOs []*model.LockDO) bool + func (dao *LockStoreDataBaseDao) UnLock(lockDOs []*model.LockDO) bool + func (dao *LockStoreDataBaseDao) UnLockByLockDO(lockDO *model.LockDO) bool + func (dao *LockStoreDataBaseDao) UnLockByXIDAndBranchID(xid string, branchID int64) bool + func (dao *LockStoreDataBaseDao) UnLockByXIDAndBranchIDs(xid string, branchIDs []int64) bool + type MemoryLocker struct + BucketHolder *sync.Map + LockKeyCount int64 + LockMap *sync.Map + func (ml *MemoryLocker) AcquireLock(branchSession *session.BranchSession) bool + func (ml *MemoryLocker) CleanAllLocks() + func (ml *MemoryLocker) GetLockKeyCount() int64 + func (ml *MemoryLocker) IsLockable(xid string, resourceID string, lockKey string) bool + func (ml *MemoryLocker) ReleaseGlobalSessionLock(globalSession *session.GlobalSession) bool + func (ml *MemoryLocker) ReleaseLock(branchSession *session.BranchSession) bool + type RowLock struct + BranchID int64 + Feature string + Pk string + ResourceID string + RowKey string + TableName string + TransactionID int64 + XID string