Documentation ¶
Index ¶
- type EmptyTransactionCoordinator
- func (tc *EmptyTransactionCoordinator) ActiveGCount() int
- func (tc *EmptyTransactionCoordinator) BranchTransactionNotifyACK(ack meta.NotifyACK)
- func (tc *EmptyTransactionCoordinator) ChangeLeaderTo(id uint64)
- func (tc *EmptyTransactionCoordinator) CommitGlobalTransaction(gid uint64, who string, cb func(meta.GlobalStatus, error))
- func (tc *EmptyTransactionCoordinator) CurrentLeader() (uint64, error)
- func (tc *EmptyTransactionCoordinator) GlobalTransactionStatus(gid uint64, cb func(meta.GlobalStatus, error))
- func (tc *EmptyTransactionCoordinator) HandleEvent() bool
- func (tc *EmptyTransactionCoordinator) HandleManual()
- func (tc *EmptyTransactionCoordinator) IsLeader() bool
- func (tc *EmptyTransactionCoordinator) Lockable(resource string, gid uint64, lockKeys []meta.LockKey, cb func(bool, error))
- func (tc *EmptyTransactionCoordinator) RegistryBranchTransaction(value meta.CreateBranchTransaction, cb func(uint64, error))
- func (tc *EmptyTransactionCoordinator) RegistryGlobalTransaction(value meta.CreateGlobalTransaction, cb func(uint64, error))
- func (tc *EmptyTransactionCoordinator) ReportBranchTransactionStatus(value meta.ReportBranchStatus, cb func(error))
- func (tc *EmptyTransactionCoordinator) RollbackGlobalTransaction(gid uint64, who string, cb func(meta.GlobalStatus, error))
- func (tc *EmptyTransactionCoordinator) Stop()
- type ManualAPI
- type Option
- func WithACKTimeout(value time.Duration) Option
- func WithCommitIfAllBranchSucceedInPhaseOne(value bool) Option
- func WithConcurrency(concurrency int) Option
- func WithElector(value election.Elector) Option
- func WithElectorOptions(value ...election.Option) Option
- func WithIDGenerator(value id.Generator) Option
- func WithStatusChangeAware(becomeLeader, becomeFollower func()) Option
- func WithStorage(value storage.Storage) Option
- func WithTransactionTimeout(value time.Duration) Option
- type QueryAPI
- type TransactionCoordinator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmptyTransactionCoordinator ¶
type EmptyTransactionCoordinator struct { }
EmptyTransactionCoordinator do nothing TransactionCoordinator
func (*EmptyTransactionCoordinator) ActiveGCount ¶
func (tc *EmptyTransactionCoordinator) ActiveGCount() int
ActiveGCount empty implementation
func (*EmptyTransactionCoordinator) BranchTransactionNotifyACK ¶
func (tc *EmptyTransactionCoordinator) BranchTransactionNotifyACK(ack meta.NotifyACK)
BranchTransactionNotifyACK empty implementation
func (*EmptyTransactionCoordinator) ChangeLeaderTo ¶
func (tc *EmptyTransactionCoordinator) ChangeLeaderTo(id uint64)
ChangeLeaderTo empty implementation
func (*EmptyTransactionCoordinator) CommitGlobalTransaction ¶
func (tc *EmptyTransactionCoordinator) CommitGlobalTransaction(gid uint64, who string, cb func(meta.GlobalStatus, error))
CommitGlobalTransaction empty implementation
func (*EmptyTransactionCoordinator) CurrentLeader ¶
func (tc *EmptyTransactionCoordinator) CurrentLeader() (uint64, error)
CurrentLeader empty implementation
func (*EmptyTransactionCoordinator) GlobalTransactionStatus ¶
func (tc *EmptyTransactionCoordinator) GlobalTransactionStatus(gid uint64, cb func(meta.GlobalStatus, error))
GlobalTransactionStatus empty implementation
func (*EmptyTransactionCoordinator) HandleEvent ¶
func (tc *EmptyTransactionCoordinator) HandleEvent() bool
HandleEvent empty implementation
func (*EmptyTransactionCoordinator) HandleManual ¶
func (tc *EmptyTransactionCoordinator) HandleManual()
HandleManual empty implementation
func (*EmptyTransactionCoordinator) IsLeader ¶
func (tc *EmptyTransactionCoordinator) IsLeader() bool
IsLeader empty implementation
func (*EmptyTransactionCoordinator) Lockable ¶
func (tc *EmptyTransactionCoordinator) Lockable(resource string, gid uint64, lockKeys []meta.LockKey, cb func(bool, error))
Lockable empty implementation
func (*EmptyTransactionCoordinator) RegistryBranchTransaction ¶
func (tc *EmptyTransactionCoordinator) RegistryBranchTransaction(value meta.CreateBranchTransaction, cb func(uint64, error))
RegistryBranchTransaction empty implementation
func (*EmptyTransactionCoordinator) RegistryGlobalTransaction ¶
func (tc *EmptyTransactionCoordinator) RegistryGlobalTransaction(value meta.CreateGlobalTransaction, cb func(uint64, error))
RegistryGlobalTransaction empty implementation
func (*EmptyTransactionCoordinator) ReportBranchTransactionStatus ¶
func (tc *EmptyTransactionCoordinator) ReportBranchTransactionStatus(value meta.ReportBranchStatus, cb func(error))
ReportBranchTransactionStatus empty implementation
func (*EmptyTransactionCoordinator) RollbackGlobalTransaction ¶
func (tc *EmptyTransactionCoordinator) RollbackGlobalTransaction(gid uint64, who string, cb func(meta.GlobalStatus, error))
RollbackGlobalTransaction empty implementation
func (*EmptyTransactionCoordinator) Stop ¶
func (tc *EmptyTransactionCoordinator) Stop()
Stop empty implementation
type ManualAPI ¶
type ManualAPI interface { // Commit commit global transaction Commit(fid, gid uint64) error // Rollback rollback global transaction Rollback(fid, gid uint64) error }
ManualAPI manual api
type Option ¶
type Option func(*options)
Option option
func WithACKTimeout ¶
WithACKTimeout set ackTimeout times
func WithCommitIfAllBranchSucceedInPhaseOne ¶
WithCommitIfAllBranchSucceedInPhaseOne set commitIfAllBranchSucceedInPhaseOne
func WithElectorOptions ¶
WithElectorOptions set leader elector options
func WithIDGenerator ¶
WithIDGenerator set id generator
func WithStatusChangeAware ¶
func WithStatusChangeAware(becomeLeader, becomeFollower func()) Option
WithStatusChangeAware set leader follow handler
func WithStorage ¶
WithStorage set meta storage options
type QueryAPI ¶
type QueryAPI interface { // CountTransactions returns transaction count CountTransactions(fid uint64) (uint64, error) // Transactions returns a transaction list Transactions(fid uint64, query meta.Query) ([]meta.GlobalTransaction, error) // Transaction returns the spec transaction Transaction(fid uint64, gid uint64) (*meta.GlobalTransaction, error) }
QueryAPI query api
type TransactionCoordinator ¶
type TransactionCoordinator interface { // Stop stop tc Stop() // ActiveGCount returns number of the actived global transaction ActiveGCount() int // IsLeader returns true if current node is leader IsLeader() bool // ChangeLeaderTo change leader to the spec peer ChangeLeaderTo(id uint64) // CurrentLeader returns the current leader CurrentLeader() (uint64, error) // HandleEvent process event // return false if no event HandleEvent() bool // HandleManual process manual requests HandleManual() // RegistryGlobalTransaction registry a global transaction RegistryGlobalTransaction(value meta.CreateGlobalTransaction, cb func(uint64, error)) // RegistryBranchTransaction registry a branch transaction RegistryBranchTransaction(value meta.CreateBranchTransaction, cb func(uint64, error)) // ReportBranchTransactionStatus report branch transaction status, phase one ReportBranchTransactionStatus(value meta.ReportBranchStatus, cb func(error)) // GlobalTransactionStatus return global status GlobalTransactionStatus(gid uint64, cb func(meta.GlobalStatus, error)) // CommitGlobalTransaction commit global CommitGlobalTransaction(gid uint64, who string, cb func(meta.GlobalStatus, error)) // RollbackGlobalTransaction rollback global RollbackGlobalTransaction(gid uint64, who string, cb func(meta.GlobalStatus, error)) // BranchTransactionNotifyACK branch transaction commit/rollback result ack BranchTransactionNotifyACK(ack meta.NotifyACK) // Lockable returns true if can be locked Lockable(resource string, gid uint64, lockKeys []meta.LockKey, cb func(bool, error)) }
TransactionCoordinator Seata transaction manager